Skip to content

Commit

Permalink
feat: support node 18 [HEAD-497] (#4911)
Browse files Browse the repository at this point in the history
* feat: use Node 18

* chore(ci): add logs when installing Node

* chore: update Docker CLI image version

* chore: update tap to 18.5.0 and fix related files

* fix: replace deprecated Tap APIs

* fix: use notOk instead of .equal with

* chore: remove parallel execution of tap tests

* fix: replace deprecated TAP APIs and remove coverage

* fix: request tests

* fix: replace t.false with t.notOk

* chore: disable TAP proxy.test

* chore: remove unused variable

* fix: replace t.contains with t.match

* fix: proxy test

* chore: increase timeout to reduce flakiness

* chore: upgrade nock

* fix: linter warnings

* chore: tap allow incomplete coverage

* chore: remove unused command

* fix: allow any version compatible with node 18

* chore: improve e2e tests

* fix: e2e test

* fix: remove -d in e2e tests

---------

Co-authored-by: Catalina Oyaneder <cat2608@gmail.com>
  • Loading branch information
PeterSchafer and cat2608 committed Oct 23, 2023
1 parent 8de2e84 commit ec10ecb
Show file tree
Hide file tree
Showing 27 changed files with 8,421 additions and 3,127 deletions.
1 change: 1 addition & 0 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y \
faketime \
zip \
nodejs=$(apt-cache policy nodejs | grep nodesource | xargs | cut -d " " -f2)
RUN node -v
RUN apt-get auto-remove -y && apt-get clean -y && rm -rf /var/lib/apt/

# install aws cli
Expand Down
28 changes: 6 additions & 22 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ executors:
- image: alpine:3.17
docker-amd64:
docker:
- image: bastiandoetsch209/cli-build:20230912-103845
- image: bastiandoetsch209/cli-build:20231012-101806
working_directory: /mnt/ramdisk/snyk
resource_class: large
docker-arm64:
docker:
- image: bastiandoetsch209/cli-build-arm64:20230912-103845
- image: bastiandoetsch209/cli-build-arm64:20231012-101806
working_directory: /mnt/ramdisk/snyk
resource_class: arm.large
linux-ubuntu-mantic-amd64:
Expand Down Expand Up @@ -214,25 +214,6 @@ commands:
os: win
- install-deps-windows-signing

install-deps-windows-node:
steps:
- restore_cache:
name: Restoring Chocolatey cache
keys:
- chocolatey-cache-v3-{{ arch }}-{{ checksum ".circleci/chocolatey.config" }}
- run:
name: Install Windows dependencies
shell: bash.exe
command: |
choco uninstall nodejs -y
choco uninstall nodejs.install -y
choco install nodejs --version=$(head .nvmrc) --no-progress -y
- save_cache:
name: Saving Chocolatey cache
key: chocolatey-cache-v3-{{ arch }}-{{ checksum ".circleci/chocolatey.config" }}
paths:
- ~\AppData\Local\Temp\chocolatey

install-deps-noop:
steps:
- run:
Expand Down Expand Up @@ -822,7 +803,7 @@ jobs:
- run:
name: Running Tap tests
command:
npx tap -Rspec --timeout=300 --node-arg=-r --node-arg=ts-node/register \
npx tap -j 1 -C --timeout=300 --node-arg=-r --node-arg=ts-node/register --allow-incomplete-coverage \
$(circleci tests glob "test/tap/*.test.*" | circleci tests split --split-by=timings)

build-special-artifacts:
Expand Down Expand Up @@ -1096,10 +1077,13 @@ jobs:
- run:
name: Checking Snyk CLI
shell: bash
environment:
SNYK_DISABLE_ANALYTICS: 1
command: |
PIP_BREAK_SYSTEM_PACKAGES=1 pip install --user --upgrade requests || PIP_BREAK_SYSTEM_PACKAGES=1 pip3 install --user --upgrade requests
python scripts/install-snyk.py --base_url=<< parameters.cli_download_base_url >> $(cat binary-releases/version) || python3 scripts/install-snyk.py --base_url=<< parameters.cli_download_base_url >> $(cat binary-releases/version)
SNYK_TOKEN=${TEST_SNYK_TOKEN} ./snyk whoami --experimental
SNYK_TOKEN=${TEST_SNYK_TOKEN} ./snyk woof
release-s3:
executor: docker-amd64
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ test/**/.gradle
test-output
test-results
tap-output

.tap
# Jest
coverage
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.16.0
18.18.1

0 comments on commit ec10ecb

Please sign in to comment.