Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infra: run tests for integrations and core packages separately #2380

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
07d14ee
infra: run tests for integrations and core packages separately
tzachbon Mar 8, 2022
05faefa
"fix: use `npm run ...` in the action and fix script name
tzachbon Mar 8, 2022
1dcacf3
fix: unsupported nullish coalescing
tzachbon Mar 8, 2022
411ac63
fix: unsupported optional chaining
tzachbon Mar 8, 2022
9e288c7
fix: spawn with shell
tzachbon Mar 9, 2022
9b11407
fix: remove unused launch configurations
tzachbon Mar 9, 2022
628ff95
fix: add quots to the glob string inside the spawn
tzachbon Mar 9, 2022
7680a1d
fix: use fork instead of spawn
tzachbon Mar 9, 2022
b3514a5
feat: add experimental-loader to the integraions-list
tzachbon Mar 9, 2022
c6edd12
Merge remote-tracking branch 'origin/master' into tzach/run-tests-for…
tzachbon Mar 9, 2022
e50c12f
chore: update package-lock
tzachbon Mar 9, 2022
daab302
feat: ts-check and run as promise
tzachbon Mar 9, 2022
500ea38
fix(test-runner): use exitCode from then
tzachbon Mar 14, 2022
e1ac110
fix: scripts to use npm run test
tzachbon Mar 14, 2022
f0dbaa1
fix: update to exitCode 1 on error
tzachbon Mar 15, 2022
3820250
test CI failure for core packages
tzachbon Mar 17, 2022
94fca3f
Revert "test CI failure for core packages"
tzachbon Mar 17, 2022
4be79b1
test CI failure for integrations specs
tzachbon Mar 17, 2022
feae4db
Revert "test CI failure for integrations specs"
tzachbon Mar 18, 2022
d1531e6
feat: create temp dir under the root dir
tzachbon Mar 20, 2022
7632522
Merge remote-tracking branch 'origin/master' into tzach/run-tests-for…
tzachbon Mar 20, 2022
0d07e54
refactor: remove comment
tzachbon Mar 20, 2022
4f18174
Merge remote-tracking branch 'origin/master' into tzach/run-tests-for…
tzachbon Mar 21, 2022
eca7162
Merge remote-tracking branch 'origin/master' into tzach/run-tests-for…
tzachbon Mar 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ jobs:
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm test
- run: npm run test:core-packages
- run: npm run test:integrations
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,7 @@ build/Release

# next.js build output
.next


# test temp directory
.temp
25 changes: 2 additions & 23 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"type": "pwa-node",
"request": "launch",
"name": "Mocha Current",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": ["--timeout", "999999", "packages/*/dist/**/${fileBasenameNoExtension}.js"],
"program": "${workspaceFolder}/scripts/test-runner.js",
"args": ["--glob", "packages/*/dist/**/${fileBasenameNoExtension}.js", "--timeout", "999999"],
"runtimeArgs": ["--enable-source-maps"],
"preLaunchTask": "npm: build",
"internalConsoleOptions": "openOnSessionStart",
Expand All @@ -26,27 +26,6 @@
"FILE": "${file}",
"CLI_WATCH_TEST_TIMEOUT": "999999"
}
},
{
"type": "node",
"request": "launch",
"name": "Plugin Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"${workspaceFolder}/packages/webpack-plugin/test/**/**.spec.{ts,tsx}",
"--timeout",
"999999"
],
"internalConsoleOptions": "openOnSessionStart"
},
{
"type": "node",
"request": "launch",
"name": "CLI Mocha Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"cwd": "${workspaceFolder}/packages/cli",
"args": ["${workspaceFolder}/packages/cli/test/**/**.spec.{ts,tsx}", "--timeout", "999999"],
"internalConsoleOptions": "openOnSessionStart"
}
]
}
94 changes: 62 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"watch": "npm run build -- -w",
"lint": "eslint .",
"pretest": "npm run build",
"test": "mocha \"./packages/*/dist/test/**/*.spec.js\" --parallel --timeout 10000",
"test": "node scripts/test-runner.js",
"test:integrations": "npm run test -- --i",
"test:core-packages": "npm run test -- --cp",
"prettify": "npx prettier . --write"
},
"devDependencies": {
Expand Down Expand Up @@ -52,7 +54,6 @@
"chai": "^4.3.6",
"chai-subset": "^1.6.0",
"create-listening-server": "^1.0.0",
"create-temp-directory": "^1.1.1",
"eslint": "^8.11.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react": "^7.29.4",
Expand Down Expand Up @@ -80,7 +81,8 @@
"ts-expect": "^1.3.0",
"typescript": "~4.6.2",
"url-loader": "^4.1.1",
"webpack": "^5.70.0"
"webpack": "^5.70.0",
"yargs": "^17.3.1"
},
"engines": {
"node": ">=12"
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/test/cli-codemod.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { populateDirectorySync, loadDirSync, runCliCodeMod } from '@stylable/e2e-test-kit';
import {
populateDirectorySync,
loadDirSync,
runCliCodeMod,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';
import type { CodeMod } from '@stylable/cli';

describe('Stylable Cli Code Mods', () => {
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/test/cli.spec.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import { join } from 'path';
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { evalStylableModule } from '@stylable/module-utils/dist/test/test-kit';
import { resolveNamespace } from '@stylable/node';
import { loadDirSync, populateDirectorySync, runCliSync } from '@stylable/e2e-test-kit';
import {
loadDirSync,
populateDirectorySync,
runCliSync,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';
import { STImport, STVar } from '@stylable/core/dist/features';

describe('Stylable Cli', function () {
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/test/code-format-cli.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { join } from 'path';
import { loadDirSync, populateDirectorySync, runFormatCliSync } from '@stylable/e2e-test-kit';
import {
loadDirSync,
populateDirectorySync,
runFormatCliSync,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';

describe('Stylable Code Format Cli', function () {
let tempDir: ITempDirectory;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { CSSCustomProperty } from '@stylable/core/dist/features';
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { populateDirectorySync, loadDirSync, runCliCodeMod } from '@stylable/e2e-test-kit';
import {
populateDirectorySync,
loadDirSync,
runCliCodeMod,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';

describe('CLI Codemods st-global-custom-property-to-at-property', () => {
let tempDir: ITempDirectory;
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/test/codemods/st-import-to-at-import.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import { parseImportMessages } from '@stylable/core/dist/helpers/import';
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { populateDirectorySync, loadDirSync, runCliCodeMod } from '@stylable/e2e-test-kit';
import {
populateDirectorySync,
loadDirSync,
runCliCodeMod,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';

describe('CLI Codemods st-import-to-at-import', () => {
let tempDir: ITempDirectory;
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/test/config-options.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { readFileSync } from 'fs';
import { join } from 'path';
import { loadDirSync, populateDirectorySync, runCliSync } from '@stylable/e2e-test-kit';
import {
loadDirSync,
populateDirectorySync,
runCliSync,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';

describe('Stylable CLI config file options', function () {
this.timeout(25000);
Expand Down
9 changes: 7 additions & 2 deletions packages/cli/test/config-presets.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { loadDirSync, populateDirectorySync, runCliSync } from '@stylable/e2e-test-kit';
import {
loadDirSync,
populateDirectorySync,
runCliSync,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';

describe('Stylable CLI config presets', function () {
this.timeout(25000);
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/test/config-projects.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { join } from 'path';
import {
symlinkSymbol,
loadDirSync,
populateDirectorySync,
runCliSync,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';
import { STVar } from '@stylable/core/dist/features';

Expand Down
3 changes: 2 additions & 1 deletion packages/cli/test/watch-multiple-projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import {
loadDirSync,
populateDirectorySync,
writeToExistingFile,
createTempDirectory,
ITempDirectory,
} from '@stylable/e2e-test-kit';
import { expect } from 'chai';
import { createTempDirectory, ITempDirectory } from 'create-temp-directory';
import { realpathSync, promises } from 'fs';
import { join, sep } from 'path';

Expand Down
Loading