Randomize folder for concurrent builds

This commit is contained in:
Danny McCormick 2019-06-07 17:30:33 -04:00
parent 1bb67f3744
commit 3af5b19a98

View file

@ -3,8 +3,26 @@ import fs = require('fs');
import os = require('os');
import path = require('path');
const toolDir = path.join(process.cwd(), 'runner', 'tools');
const tempDir = path.join(process.cwd(), 'runner', 'temp');
const toolDir = path.join(
process.cwd(),
'runner',
path.join(
Math.random()
.toString(36)
.substring(7)
),
'tools'
);
const tempDir = path.join(
process.cwd(),
'runner',
path.join(
Math.random()
.toString(36)
.substring(7)
),
'temp'
);
process.env['RUNNER_TOOLSDIRECTORY'] = toolDir;
process.env['RUNNER_TEMPDIRECTORY'] = tempDir;
@ -18,6 +36,11 @@ describe('installer tests', () => {
await io.rmRF(tempDir);
}, 100000);
afterAll(async () => {
await io.rmRF(toolDir);
await io.rmRF(tempDir);
}, 100000);
it('Acquires version of node if no matching version is installed', async () => {
await installer.getNode('10.16.0');
const nodeDir = path.join(toolDir, 'node', '10.16.0', os.arch());