diff --git a/.circleci/test-deploy.yml b/.circleci/test-deploy.yml index eb5314e..cfe346a 100644 --- a/.circleci/test-deploy.yml +++ b/.circleci/test-deploy.yml @@ -362,6 +362,22 @@ workflows: command: | rm ~/project/sample/pnpm-lock.yaml rm ~/project/sample/yarn.lock + - node/test: + filters: *filters + name: node-test-no-junit-new-features + app-dir: "~/project/sample" + cache-version: v1 + executor: machine + parallelism: 4 + post_install_steps: + - run: | + echo "Packages installed" + setup: + - run: + name: Remove other lock files + command: | + rm ~/project/sample/pnpm-lock.yaml + rm ~/project/sample/yarn.lock - node/test: filters: *filters name: node-test-with-coverage diff --git a/src/commands/install-packages.yml b/src/commands/install-packages.yml index 871422f..77dfc94 100644 --- a/src/commands/install-packages.yml +++ b/src/commands/install-packages.yml @@ -53,7 +53,7 @@ parameters: description: Change the default cache version if you need to clear the cache for any reason. include-branch-in-cache-key: type: boolean - default: true + default: false description: > If true, this cache bucket will only apply to jobs within the same branch. diff --git a/src/jobs/run.yml b/src/jobs/run.yml index c6a5f59..10c5f39 100644 --- a/src/jobs/run.yml +++ b/src/jobs/run.yml @@ -2,6 +2,10 @@ description: | Simple drop-in job to run commands for your Node.js application automatically. parameters: + parallelism: + type: integer + default: 1 + description: The number of parallel jobs to run. See https://circleci.com/docs/parallelism-faster-jobs/ pkg-manager: type: enum enum: ['npm', 'yarn', 'yarn-berry', 'pnpm'] @@ -15,6 +19,10 @@ parameters: type: steps description: Provide any optional steps you would like to run prior to installing the node dependencies. This is a good place to install global modules. default: [] + post_install_steps: + type: steps + description: Provide any optional steps you would like to run after installing the node dependencies. + default: [] npm-run: type: string default: '' @@ -44,7 +52,7 @@ parameters: default: '' include-branch-in-cache-key: type: boolean - default: true + default: false description: > If true, this cache bucket will only apply to jobs within the same branch. cache-path: @@ -76,11 +84,10 @@ parameters: executor: type: executor default: default - description: | - The name of executor to use. + description: The name of executor to use. executor: <> - +parallelism: <> steps: - checkout - steps: << parameters.setup >> @@ -94,6 +101,7 @@ steps: cache-only-lockfile: <> with-cache: <> check-cache: <> + - steps: << parameters.post_install_steps >> - run: name: Run <> <> working_directory: <> diff --git a/src/jobs/test.yml b/src/jobs/test.yml index 7ceab30..d9fc583 100644 --- a/src/jobs/test.yml +++ b/src/jobs/test.yml @@ -2,6 +2,10 @@ description: | Simple drop-in job to test your Node.js application automatically. parameters: + parallelism: + type: integer + default: 1 + description: The number of parallel jobs to run. See https://circleci.com/docs/parallelism-faster-jobs/ pkg-manager: type: enum enum: ['npm', 'yarn', 'yarn-berry', 'pnpm'] @@ -15,6 +19,10 @@ parameters: type: steps description: Provide any optional steps you would like to run prior to installing the node dependencies. This is a good place to install global modules. default: [] + post_install_steps: + type: steps + description: Provide any optional steps you would like to run after installing the node dependencies. + default: [] run-command: type: string default: 'test' @@ -51,7 +59,7 @@ parameters: The code coverage files will be uploaded to artifacts for this workflow. include-branch-in-cache-key: type: boolean - default: true + default: false description: > If true, this cache bucket will only apply to jobs within the same branch. cache-path: @@ -83,11 +91,10 @@ parameters: executor: type: executor default: default - description: | - The name of executor to use. + description: The name of executor to use. executor: <> - +parallelism: <> steps: - checkout - steps: << parameters.setup >> @@ -101,6 +108,7 @@ steps: cache-only-lockfile: <> with-cache: <> check-cache: <> + - steps: << parameters.post_install_steps >> - when: # Run tests for NPM, without test results condition: and: @@ -250,17 +258,17 @@ steps: working_directory: <> command: pnpm run <> --reporter mocha-multi --reporter-options spec=-,mocha-junit-reporter=- - when: # upload test results if a path was given - condition: << parameters.test-results-path >> - steps: - store_test_results: - path: << parameters.test-results-path >> + condition: << parameters.test-results-path >> + steps: + - store_test_results: + path: << parameters.test-results-path >> - when: # upload test results if jest was automatically configured and test-results-path is not specified condition: and: - equal: [jest, << parameters.test-results-for >>] - equal: ['', << parameters.test-results-path >>] steps: - store_test_results: + - store_test_results: path: <>/junit.xml - when: # upload test results if mocha was automatically configured and test-results-path is not specified condition: @@ -268,7 +276,7 @@ steps: - equal: [mocha, << parameters.test-results-for >>] - equal: ['', << parameters.test-results-path >>] steps: - store_test_results: + - store_test_results: path: <>/test-results.xml - when: # upload coverage files if test-coverage-path was configured condition: <>