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

test: attempt to parallelize acceptance tests #4415

Closed
wants to merge 11 commits into from
50 changes: 44 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,16 @@ commands:
- restore_cache:
name: Restoring Chocolatey cache
keys:
- chocolatey-cache-v2-{{ arch }}-{{ checksum ".circleci/chocolatey.config" }}
- chocolatey-cache-v20230226-{{ arch }}-{{ checksum ".circleci/chocolatey.config" }}
- run:
name: Installing SDKs
command: choco install .circleci/chocolatey.config --no-progress
- save_cache:
name: Saving Chocolatey cache
key: chocolatey-cache-v2-{{ arch }}-{{ checksum ".circleci/chocolatey.config" }}
key: chocolatey-cache-v20230226-{{ arch }}-{{ checksum ".circleci/chocolatey.config" }}
paths:
- ~\AppData\Local\Temp\chocolatey
- C:\ProgramData\chocolatey\lib
install_sdks_unix:
steps:
- restore_cache:
Expand Down Expand Up @@ -327,29 +328,58 @@ jobs:
unset SNYK_API
unset SNYK_API_KEY
shellspec -f d -e REGRESSION_TEST=1
test-windows-setup:
executor: win/default
working_directory: C:\Users\circleci\snyk
steps:
- run:
name: Configuring Git
command: git config --global core.autocrlf false
- checkout
- attach_workspace:
at: .
- install_sdks_windows
- run:
name: Refresh ENV vars
command: |
echo $env:PATH
refreshenv
echo $env:PATH
- setup_npm:
npm_install: true
npm_cache_directory: ~\AppData\Local\npm-cache
test-windows:
parameters:
test_snyk_command:
type: string
executor: win/default
working_directory: C:\Users\circleci\snyk
parallelism: 4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is that the number of cores on the worker?

steps:
- run:
name: Configuring Git
command: git config --global core.autocrlf false
- checkout
- attach_workspace:
at: .
- install_sdks_windows
- install_sdks_windows # This step will restore the cache
- run:
name: Refresh ENV vars
command: |
echo $env:PATH
refreshenv
echo $env:PATH
- setup_npm:
npm_install: true # reinstalling as workspace node_modules is for linux
npm_install: true
npm_cache_directory: ~\AppData\Local\npm-cache
- run:
name: Configuring artifact
command: << parameters.test_snyk_command >> config set "api=$env:SNYK_API_KEY"
- run:
name: Testing artifact
command: npm run test:acceptance -- --selectProjects snyk
command: |
$test = circleci tests glob "**/test/jest/acceptance/**" | circleci tests split --split-by=timings
npm run test:acceptance -- --selectProjects snyk --runTestsByPath $test
environment:
TEST_SNYK_COMMAND: << parameters.test_snyk_command >>
test-macos:
Expand Down Expand Up @@ -1047,14 +1077,22 @@ workflows:
- snyk-for-docker-desktop-darwin-x64.tar.gz
- snyk-for-docker-desktop-darwin-arm64.tar.gz
- docker-mac-signed-bundle.tar.gz
- test-windows-setup:
filters:
branches:
ignore: master
name: Acceptance Tests (snyk-win.exe) - Setup
context: nodejs-install
requires:
- Build (snyk-win.exe)
- test-windows:
filters:
branches:
ignore: master
name: Acceptance Tests (snyk-win.exe)
context: nodejs-install
requires:
- Build (snyk-win.exe)
- Acceptance Tests (snyk-win.exe) - Setup
test_snyk_command: C:\Users\circleci\snyk\binary-releases\snyk-win.exe
- test-macos:
filters:
Expand Down