From 86889d5259621b4331641ffa56b33e420a45970f Mon Sep 17 00:00:00 2001 From: Ray Foss Date: Tue, 5 Oct 2021 16:35:41 -0500 Subject: [PATCH 1/2] [dove/hygen-cli] Name temp dirs like feathers_ts_koa Instead of test folders being named like this: ``` drwx------ 7 sandbox sandbox 4.0K Oct 5 20:53 feathers-O7C15n drwx------ 7 sandbox sandbox 4.0K Oct 5 20:53 feathers-GGIGRy drwx------ 7 sandbox sandbox 4.0K Oct 5 20:52 feathers-cz5zXe drwx------ 7 sandbox sandbox 4.0K Oct 5 20:52 feathers-eQiVHK drwx------ 7 sandbox sandbox 4.0K Oct 5 20:49 feathers-ewzTXi drwx------ 7 sandbox sandbox 4.0K Oct 5 20:43 feathers-qRmKUw drwx------ 7 sandbox sandbox 4.0K Oct 5 20:41 feathers-HyM5uj drwx------ 7 sandbox sandbox 4.0K Oct 5 20:37 feathers-ZgnC7M drwx------ 7 sandbox sandbox 4.0K Oct 5 20:31 feathers-IIUqZJ ``` Names them like this: ``` drwx------ 8 sandbox sandbox 4.0K Oct 5 21:09 feathers_ts_koa-fxVBjf drwx------ 7 sandbox sandbox 4.0K Oct 5 21:07 feathers_ts_express-Nj0Nfm drwx------ 7 sandbox sandbox 4.0K Oct 5 21:07 feathers_js_express-3A31J1 drwx------ 7 sandbox sandbox 4.0K Oct 5 21:06 feathers_js_koa-DPoCLs ``` Also kindof "addresses" the github timing out problem... by running the dev suite of tests if on github --- packages/cli/test/index.test.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/cli/test/index.test.ts b/packages/cli/test/index.test.ts index 44b6cf0791..dadbfa18db 100644 --- a/packages/cli/test/index.test.ts +++ b/packages/cli/test/index.test.ts @@ -31,25 +31,22 @@ function combinate> (obj: O) { } return combos; } -const combinations = process.env.CI ? combinate(matrix) : [defaultCombination]; +// Github CI can't handle the matrix... GITHUB_REF is refs/heads/feature-branch-1 +const combinations = process.env.CI && !process.env.GITHUB_REF ? combinate(matrix) : [defaultCombination]; describe('@feathersjs/cli', () => { const oldCwd = process.cwd(); - let tmpDir: string; - - beforeEach(async () => { - tmpDir = await mkdtemp(path.join(os.tmpdir(), 'feathers-')); - process.chdir(tmpDir); - }); afterEach(() => process.chdir(oldCwd)); for (const { language, framework } of combinations) { it(`generates ${language} ${framework} app and passes tests`, async () => { + const name = `feathers_${language}_${framework}`; + const tmpDir = await mkdtemp(path.join(os.tmpdir(), name + '-')); const appPrompts = { framework, language, - name: 'feathers-cli-test', + name: name, description: 'The Feathers CLI test app', lib: 'src', packager: 'npm', From a114f632bff6c16888b7b63908a1b2fc41999c97 Mon Sep 17 00:00:00 2001 From: Ray Foss Date: Tue, 5 Oct 2021 16:46:06 -0500 Subject: [PATCH 2/2] Update index.test.ts --- packages/cli/test/index.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/test/index.test.ts b/packages/cli/test/index.test.ts index dadbfa18db..073cc1dd65 100644 --- a/packages/cli/test/index.test.ts +++ b/packages/cli/test/index.test.ts @@ -31,8 +31,8 @@ function combinate> (obj: O) { } return combos; } -// Github CI can't handle the matrix... GITHUB_REF is refs/heads/feature-branch-1 -const combinations = process.env.CI && !process.env.GITHUB_REF ? combinate(matrix) : [defaultCombination]; + +const combinations = process.env.CI ? combinate(matrix) : [defaultCombination]; describe('@feathersjs/cli', () => { const oldCwd = process.cwd();