From 848134e36c7d937c3c5728ad6aece2060bf5cd00 Mon Sep 17 00:00:00 2001 From: aweng98 Date: Mon, 25 Sep 2023 13:58:42 -0400 Subject: [PATCH 1/5] update circleci config to download nodejs --- .circleci/config.yml | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f8e95f352..ba59f77bc2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -690,25 +690,30 @@ jobs: # export env from file (created in build-playwright-job) cat playwright-env/envvars | awk '{print "export " $0}' >> "$BASH_ENV" source $BASH_ENV - - node/install: - install-yarn: false - node-version: '18.13.0' # LTS version - run: - working_directory: *playwright_path - command: npm install --quiet + name: "Update node.js and npm" + command: | + curl -sSL "https://nodejs.org/dist/latest-v18.x//node-v18.18.0-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v18.18.0-linux-x64/bin/node + curl https://www.npmjs.com/install.sh | sudo bash - run: - working_directory: *playwright_path - command: npx playwright install --with-deps chromium # Only need Chrome browser - + name: Check current version of node + command: node -v - run: - name: Running Playwright tests on << parameters.env >> working_directory: *playwright_path - command: | - npx playwright test --list | grep -o 'tests/.*.spec.ts' | sort | uniq > e2e_tests.txt - TESTS_FILE=$(circleci tests split --split-by=timings --timings-type=classname e2e_tests.txt) - echo $TESTS_FILE - npm run test:ci $TESTS_FILE - no_output_timeout: 5m # Default is 10m. Set shorter time to ensure CI fails faster if test hangs + command: npm ci + #- run: + # working_directory: *playwright_path + # command: npx playwright install --with-deps chromium # Only need Chrome browser + + #- run: + # name: Running Playwright tests on << parameters.env >> + # working_directory: *playwright_path + # command: | + # npx playwright test --list | grep -o 'tests/.*.spec.ts' | sort | uniq > e2e_tests.txt + # TESTS_FILE=$(circleci tests split --split-by=timings --timings-type=classname e2e_tests.txt) + # echo $TESTS_FILE + # npm run test:ci $TESTS_FILE + # no_output_timeout: 5m # Default is 10m. Set shorter time to ensure CI fails faster if test hangs - store_test_results: path: playwright-e2e/junit - store_artifacts: From 56c989689d130fe074f73394f8c77716dfdbfbb3 Mon Sep 17 00:00:00 2001 From: aweng98 Date: Mon, 25 Sep 2023 14:05:59 -0400 Subject: [PATCH 2/5] no sudo --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba59f77bc2..8967898ef0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -693,8 +693,8 @@ jobs: - run: name: "Update node.js and npm" command: | - curl -sSL "https://nodejs.org/dist/latest-v18.x//node-v18.18.0-linux-x64.tar.xz" | sudo tar --strip-components=2 -xJ -C /usr/local/bin/ node-v18.18.0-linux-x64/bin/node - curl https://www.npmjs.com/install.sh | sudo bash + curl -sSL "https://nodejs.org/dist/latest-v18.x//node-v18.18.0-linux-x64.tar.xz" | tar --strip-components=2 -xJ -C /usr/local/bin/ node-v18.18.0-linux-x64/bin/node + curl https://www.npmjs.com/install.sh | bash - run: name: Check current version of node command: node -v From c95040b431c8214b6510fad8a696e5339b38d1b0 Mon Sep 17 00:00:00 2001 From: aweng98 Date: Mon, 25 Sep 2023 14:18:01 -0400 Subject: [PATCH 3/5] no sudo --- .circleci/config.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8967898ef0..0900551227 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -693,8 +693,18 @@ jobs: - run: name: "Update node.js and npm" command: | - curl -sSL "https://nodejs.org/dist/latest-v18.x//node-v18.18.0-linux-x64.tar.xz" | tar --strip-components=2 -xJ -C /usr/local/bin/ node-v18.18.0-linux-x64/bin/node - curl https://www.npmjs.com/install.sh | bash + set +e + wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash + + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + + nvm install v18 + nvm alias default 18.18.0 + + echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV + echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV - run: name: Check current version of node command: node -v From e883c3ce7cb2161da45d2389b00324eae7c96790 Mon Sep 17 00:00:00 2001 From: aweng98 Date: Mon, 25 Sep 2023 14:28:09 -0400 Subject: [PATCH 4/5] no sudo --- .circleci/config.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0900551227..3e81075320 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -690,21 +690,6 @@ jobs: # export env from file (created in build-playwright-job) cat playwright-env/envvars | awk '{print "export " $0}' >> "$BASH_ENV" source $BASH_ENV - - run: - name: "Update node.js and npm" - command: | - set +e - wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh | bash - - export NVM_DIR="$HOME/.nvm" - [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" - [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" - - nvm install v18 - nvm alias default 18.18.0 - - echo 'export NVM_DIR="$HOME/.nvm"' >> $BASH_ENV - echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV - run: name: Check current version of node command: node -v From e6898a05c597ea58834ec354b2a0d898c5282fab Mon Sep 17 00:00:00 2001 From: aweng98 Date: Mon, 25 Sep 2023 14:36:10 -0400 Subject: [PATCH 5/5] run tests --- .circleci/config.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3e81075320..b17bd2a587 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -696,19 +696,19 @@ jobs: - run: working_directory: *playwright_path command: npm ci - #- run: - # working_directory: *playwright_path - # command: npx playwright install --with-deps chromium # Only need Chrome browser + - run: + working_directory: *playwright_path + command: npx playwright install --with-deps chromium # Only need Chrome browser - #- run: - # name: Running Playwright tests on << parameters.env >> - # working_directory: *playwright_path - # command: | - # npx playwright test --list | grep -o 'tests/.*.spec.ts' | sort | uniq > e2e_tests.txt - # TESTS_FILE=$(circleci tests split --split-by=timings --timings-type=classname e2e_tests.txt) - # echo $TESTS_FILE - # npm run test:ci $TESTS_FILE - # no_output_timeout: 5m # Default is 10m. Set shorter time to ensure CI fails faster if test hangs + - run: + name: Running Playwright tests on << parameters.env >> + working_directory: *playwright_path + command: | + npx playwright test --list | grep -o 'tests/.*.spec.ts' | sort | uniq > e2e_tests.txt + TESTS_FILE=$(circleci tests split --split-by=timings --timings-type=classname e2e_tests.txt) + echo $TESTS_FILE + npm run test:ci $TESTS_FILE + no_output_timeout: 5m # Default is 10m. Set shorter time to ensure CI fails faster if test hangs - store_test_results: path: playwright-e2e/junit - store_artifacts: