move all files to the RUNNER_TEMP directory
This commit is contained in:
parent
a0d60d5d9e
commit
5ea736059a
18 changed files with 42 additions and 61 deletions
18
lib/config-utils.test.js
generated
18
lib/config-utils.test.js
generated
|
|
@ -28,7 +28,7 @@ function setInput(name, value) {
|
|||
}
|
||||
ava_1.default("load empty config", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
setInput('config-file', undefined);
|
||||
const config = await configUtils.loadConfig();
|
||||
|
|
@ -37,7 +37,7 @@ ava_1.default("load empty config", async (t) => {
|
|||
});
|
||||
ava_1.default("loading config saves config", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
const configFile = configUtils.getConfigFile();
|
||||
// Sanity check the saved config file does not already exist
|
||||
|
|
@ -51,7 +51,7 @@ ava_1.default("loading config saves config", async (t) => {
|
|||
});
|
||||
ava_1.default("load input outside of workspace", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
setInput('config-file', '../input');
|
||||
try {
|
||||
|
|
@ -65,7 +65,7 @@ ava_1.default("load input outside of workspace", async (t) => {
|
|||
});
|
||||
ava_1.default("load non-existent input", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
t.false(fs.existsSync(path.join(tmpDir, 'input')));
|
||||
setInput('config-file', 'input');
|
||||
|
|
@ -80,7 +80,7 @@ ava_1.default("load non-existent input", async (t) => {
|
|||
});
|
||||
ava_1.default("load non-empty input", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
// Just create a generic config object with non-default values for all fields
|
||||
const inputFileContents = `
|
||||
|
|
@ -114,7 +114,7 @@ ava_1.default("load non-empty input", async (t) => {
|
|||
});
|
||||
ava_1.default("load partially invalid input", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
// The valid parts of this config should be parsed correctly.
|
||||
// The invalid parts should be ignored and left as the default values.
|
||||
|
|
@ -144,7 +144,7 @@ ava_1.default("load partially invalid input", async (t) => {
|
|||
});
|
||||
ava_1.default("load invalid input - top level entries", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
// Replace the arrays with strings or numbers.
|
||||
// The invalid parts should be ignored and left as the default values.
|
||||
|
|
@ -167,7 +167,7 @@ ava_1.default("load invalid input - top level entries", async (t) => {
|
|||
});
|
||||
ava_1.default("load invalid input - queries field type", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
// Invalid contents of the "queries" array.
|
||||
// The invalid parts should be ignored and left as the default values.
|
||||
|
|
@ -205,7 +205,7 @@ const testInputs = {
|
|||
for (const [input, result] of Object.entries(testInputs)) {
|
||||
ava_1.default("load invalid input - queries uses \"" + input + "\"", async (t) => {
|
||||
return await util.withTmpDir(async (tmpDir) => {
|
||||
process.env['RUNNER_WORKSPACE'] = tmpDir;
|
||||
process.env['RUNNER_TEMP'] = tmpDir;
|
||||
process.env['GITHUB_WORKSPACE'] = tmpDir;
|
||||
// Invalid contents of a "queries.uses" field.
|
||||
// Should fail with the expected error message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue