Skip to content

Commit

Permalink
wip: rejig test pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Jahed Ahmed committed Jan 5, 2022
1 parent d0fad9a commit 1a3fc7b
Showing 1 changed file with 112 additions and 132 deletions.
244 changes: 112 additions & 132 deletions .circleci/config.yml
Expand Up @@ -219,80 +219,65 @@ jobs:
unset SNYK_API
unset SNYK_API_KEY
shellspec -f d -e REGRESSION_TEST=1
test-windows:
unit-test:
<<: *defaults
executor: win/default
working_directory: ~\snyk
docker:
- image: cimg/node:<< parameters.node_version >>
environment:
TEMP: /mnt/ramdisk/tmp
steps:
- run:
name: Configuring Git
command: git config --global core.autocrlf false
name: Creating temporary directory
command: mkdir /mnt/ramdisk/tmp
- checkout
- install_node_windows:
- install_sdks_linux
- install_project_dependencies:
node_version: << parameters.node_version >>
- install_sdks_windows
- attach_workspace:
at: .
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
- run:
name: Running unit tests (Packages)
command: npm run test:packages-unit -- --ci
- run:
name: Running unit tests (Jest)
command: npm run test:jest-unit -- --ci
- run:
name: Running system tests (Jest)
command: npm run test:jest-system -- --ci
- run:
name: Running root tests (Jest)
command: npm run test:jest -- --ci
acceptance-test:
<<: *defaults
docker:
- image: cimg/node:<< parameters.node_version >>
environment:
TEMP: /mnt/ramdisk/tmp
steps:
- run:
name: Creating temporary directory
command: mkdir /mnt/ramdisk/tmp
- checkout
- install_sdks_linux
- aws-cli/install:
version: 2.2.32
- install_project_dependencies:
npm_cache_directory: ~\AppData\Local\npm-cache
node_version: << parameters.node_version >>
npm_global_sudo: false
- attach_workspace:
at: .
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=$env:SNYK_API_KEY"
- when:
condition: << parameters.package_tests >>
steps:
- run:
name: Running unit tests (Packages)
command: npm run test:packages-unit -- --ci
- when:
condition: << parameters.package_tests >>
steps:
- run:
name: Running acceptance tests (Packages)
command: npm run test:packages-acceptance -- --ci
- when:
condition: << parameters.root_tap_tests >>
steps:
- run:
name: Running root tests (Tap)
command: npm run test:test
- when:
condition: << parameters.jest_tests >>
steps:
- run:
name: Running root tests (Jest)
command: npm run test:jest -- --ci
- run:
name: Running unit tests (Jest)
command: npm run test:jest-unit -- --ci
- run:
name: Running system tests (Jest)
command: npm run test:jest-system -- --ci
- run:
name: Download AWS CLI
command: |
msiexec.exe /i AWSCLIV2.msi /quiet
[Environment]::SetEnvironmentVariable("Path", $env:PATH + `
";c:\Program Files\Amazon\AWSCLIV2", "Machine")
shell: powershell.exe
- run:
name: Running acceptance tests (Jest)
command: npm run test:jest-acceptance -- --ci
- when:
condition: << parameters.acceptance_tests >>
steps:
- run:
name: Running acceptance tests (Tap)
command: npm run test:acceptance
- when:
condition: << parameters.system_tests >>
steps:
- run:
name: Running system tests (Tap)
command: npm run test:system
test-linux:
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
- run:
name: Running acceptance tests (Packages)
command: npm run test:packages-acceptance -- --ci
- run:
name: Running acceptance tests (Jest)
command: npm run test:jest-acceptance -- --ci
tap-test:
<<: *defaults
docker:
- image: cimg/node:<< parameters.node_version >>
Expand All @@ -311,6 +296,36 @@ jobs:
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=${SNYK_API_KEY}"
- run:
name: Running root tests (Tap)
command: npm run test:test
- run:
name: Running system tests (Tap)
command: npm run test:system
- run:
name: Running acceptance tests (Tap)
command: npm run test:acceptance
test-windows:
<<: *defaults
executor: win/default
working_directory: ~\snyk
steps:
- run:
name: Configuring Git
command: git config --global core.autocrlf false
- checkout
- install_node_windows:
node_version: << parameters.node_version >>
- install_sdks_windows
- install_project_dependencies:
npm_cache_directory: ~\AppData\Local\npm-cache
node_version: << parameters.node_version >>
npm_global_sudo: false
- attach_workspace:
at: .
- run:
name: Configuring Snyk CLI
command: node ./bin/snyk config set "api=$env:SNYK_API_KEY"
- when:
condition: << parameters.package_tests >>
steps:
Expand Down Expand Up @@ -341,8 +356,13 @@ jobs:
- run:
name: Running system tests (Jest)
command: npm run test:jest-system -- --ci
- aws-cli/install:
version: 2.2.32
- run:
name: Download AWS CLI
command: |
msiexec.exe /i AWSCLIV2.msi /quiet
[Environment]::SetEnvironmentVariable("Path", $env:PATH + `
";c:\Program Files\Amazon\AWSCLIV2", "Machine")
shell: powershell.exe
- run:
name: Running acceptance tests (Jest)
command: npm run test:jest-acceptance -- --ci
Expand Down Expand Up @@ -453,108 +473,68 @@ workflows:
- build:
name: Build

- regression-test:
name: Regression Tests
- unit-test:
name: Unit Test
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
requires:
- Build # needed for importing local packages like @snyk/fix

- test-windows:
name: Windows, Node v14.17.5 - Packages, Jest, System Tests
- acceptance-test:
name: Acceptance Test (Node v<< matrix.node_version >>)
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
jest_tests: true
system_tests: true
package_tests: true
- test-windows:
name: Windows, Node v14.17.5 - Acceptance Tests
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
acceptance_tests: true
- test-windows:
name: Windows, Node v14.17.5 - Root Tap Tests
- Unit Test
matrix:
parameters:
node_version: ['12.22.5', '14.17.5']

- tap-test:
name: Tap Test (Node v<< matrix.node_version >>)
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
root_tap_tests: true

- test-linux:
name: Linux, Node v<< matrix.node_version >> - Packages, Jest, System Tests
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
jest_tests: true
system_tests: true
package_tests: true
- test-linux:
name: Linux, Node v<< matrix.node_version >> - Acceptance Tests
node_version: ['12.22.5', '14.17.5']

- regression-test:
name: Regression Tests
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
acceptance_tests: true
- test-linux:
name: Linux, Node v<< matrix.node_version >> - Root Tap Tests
context: nodejs-install
requires:
- Build
filters:
branches:
ignore:
- master
matrix:
parameters:
node_version: ['10.24.1', '12.22.5', '14.17.5', '16.13.0']
root_tap_tests: true

- dev-release:
name: Development Release
requires:
- Lint
- Build
filters:
branches:
ignore:
- master

- prod-release:
name: Production Release
context: nodejs-app-release
filters:
branches:
only:
- master
requires:
- Lint
- Build
# - prod-release:
# name: Production Release
# context: nodejs-app-release
# filters:
# branches:
# only:
# - master
# requires:
# - Lint
# - Build

0 comments on commit 1a3fc7b

Please sign in to comment.