mirror of
https://github.com/nasa/openmct.git
synced 2025-06-01 23:20:50 +00:00
Fixes the way we start and stop couchdb on bare metal CI agents (#6589)
This commit is contained in:
parent
dbdc9bb4e2
commit
2820237d60
@ -7,6 +7,10 @@ executors:
|
|||||||
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
|
NODE_ENV: development # Needed to ensure 'dist' folder created and devDependencies installed
|
||||||
PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps
|
PERCY_POSTINSTALL_BROWSER: 'true' # Needed to store the percy browser in cache deps
|
||||||
PERCY_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742)
|
PERCY_LOGLEVEL: 'debug' # Enable DEBUG level logging for Percy (Issue: https://github.com/nasa/openmct/issues/5742)
|
||||||
|
ubuntu:
|
||||||
|
machine:
|
||||||
|
image: ubuntu-2204:current
|
||||||
|
docker_layer_caching: true
|
||||||
parameters:
|
parameters:
|
||||||
BUST_CACHE:
|
BUST_CACHE:
|
||||||
description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!"
|
description: "Set this with the CircleCI UI Trigger Workflow button (boolean = true) to bust the cache!"
|
||||||
@ -23,9 +27,8 @@ commands:
|
|||||||
- restore_cache_cmd:
|
- restore_cache_cmd:
|
||||||
node-version: << parameters.node-version >>
|
node-version: << parameters.node-version >>
|
||||||
- node/install:
|
- node/install:
|
||||||
install-npm: true
|
|
||||||
node-version: << parameters.node-version >>
|
node-version: << parameters.node-version >>
|
||||||
- run: npm install --prefer-offline --no-audit --progress=false
|
- run: npm install --no-audit --progress=false
|
||||||
restore_cache_cmd:
|
restore_cache_cmd:
|
||||||
description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache"
|
description: "Custom command for restoring cache with the ability to bust cache. When BUST_CACHE is set to true, jobs will not restore cache"
|
||||||
parameters:
|
parameters:
|
||||||
@ -37,7 +40,7 @@ commands:
|
|||||||
equal: [false, << pipeline.parameters.BUST_CACHE >> ]
|
equal: [false, << pipeline.parameters.BUST_CACHE >> ]
|
||||||
steps:
|
steps:
|
||||||
- restore_cache:
|
- restore_cache:
|
||||||
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
save_cache_cmd:
|
save_cache_cmd:
|
||||||
description: "Custom command for saving cache."
|
description: "Custom command for saving cache."
|
||||||
parameters:
|
parameters:
|
||||||
@ -45,7 +48,7 @@ commands:
|
|||||||
type: string
|
type: string
|
||||||
steps:
|
steps:
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: deps-{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
key: deps--{{ arch }}--{{ .Branch }}--<< parameters.node-version >>--{{ checksum "package.json" }}-{{ checksum ".circleci/config.yml" }}
|
||||||
paths:
|
paths:
|
||||||
- ~/.npm
|
- ~/.npm
|
||||||
- node_modules
|
- node_modules
|
||||||
@ -53,8 +56,8 @@ commands:
|
|||||||
description: "Track important packages and files"
|
description: "Track important packages and files"
|
||||||
steps:
|
steps:
|
||||||
- run: |
|
- run: |
|
||||||
mkdir /tmp/artifacts
|
[[ $EUID -ne 0 ]] && (sudo mkdir -p /tmp/artifacts && sudo chmod 777 /tmp/artifacts) || (mkdir -p /tmp/artifacts && chmod 777 /tmp/artifacts)
|
||||||
printenv NODE_ENV >> /tmp/artifacts/NODE_ENV.txt
|
printenv NODE_ENV >> /tmp/artifacts/NODE_ENV.txt || true
|
||||||
npm -v >> /tmp/artifacts/npm-version.txt
|
npm -v >> /tmp/artifacts/npm-version.txt
|
||||||
node -v >> /tmp/artifacts/node-version.txt
|
node -v >> /tmp/artifacts/node-version.txt
|
||||||
ls -latR >> /tmp/artifacts/dir.txt
|
ls -latR >> /tmp/artifacts/dir.txt
|
||||||
@ -69,7 +72,7 @@ commands:
|
|||||||
- run: npm run cov:e2e:report || true
|
- run: npm run cov:e2e:report || true
|
||||||
- run: npm run cov:e2e:<<parameters.suite>>:publish
|
- run: npm run cov:e2e:<<parameters.suite>>:publish
|
||||||
orbs:
|
orbs:
|
||||||
node: circleci/node@4.9.0
|
node: circleci/node@5.1.0
|
||||||
browser-tools: circleci/browser-tools@1.3.0
|
browser-tools: circleci/browser-tools@1.3.0
|
||||||
jobs:
|
jobs:
|
||||||
npm-audit:
|
npm-audit:
|
||||||
@ -110,7 +113,11 @@ jobs:
|
|||||||
path: dist/reports/tests/
|
path: dist/reports/tests/
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: coverage
|
path: coverage
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
e2e-test:
|
e2e-test:
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
@ -128,8 +135,12 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- run: npx playwright install chrome-beta
|
- run: npx playwright install chrome-beta
|
||||||
- run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:<<parameters.suite>> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
|
- run: SHARD="$((${CIRCLE_NODE_INDEX}+1))"; npm run test:e2e:<<parameters.suite>> -- --shard=${SHARD}/${CIRCLE_NODE_TOTAL}
|
||||||
- generate_e2e_code_cov_report:
|
- when:
|
||||||
suite: <<parameters.suite>>
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_e2e_code_cov_report:
|
||||||
|
suite: <<parameters.suite>>
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: test-results/results.xml
|
path: test-results/results.xml
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
@ -138,24 +149,33 @@ jobs:
|
|||||||
path: coverage
|
path: coverage
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
e2e-couchdb:
|
e2e-couchdb:
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
type: string
|
type: string
|
||||||
executor: pw-focal-development
|
executor: ubuntu
|
||||||
steps:
|
steps:
|
||||||
- build_and_install:
|
- build_and_install:
|
||||||
node-version: <<parameters.node-version>>
|
node-version: <<parameters.node-version>>
|
||||||
|
- run: npx playwright@1.29.0 install #Necessary for bare ubuntu machine
|
||||||
- run: |
|
- run: |
|
||||||
export $(cat src/plugins/persistence/couch/.env.ci | xargs)
|
export $(cat src/plugins/persistence/couch/.env.ci | xargs)
|
||||||
docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach
|
docker-compose -f src/plugins/persistence/couch/couchdb-compose.yaml up --detach
|
||||||
sleep 3
|
sleep 3
|
||||||
bash src/plugins/persistence/couch/setup-couchdb.sh
|
bash src/plugins/persistence/couch/setup-couchdb.sh
|
||||||
- run: sh src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh #Replace LocalStorage Plugin with CouchDB Plugin and Config
|
- run: sh src/plugins/persistence/couch/replace-localstorage-with-couchdb-indexhtml.sh #Replace LocalStorage Plugin with CouchDB
|
||||||
- run: npm run test:e2e:couchdb
|
- run: npm run test:e2e:couchdb
|
||||||
- generate_e2e_code_cov_report:
|
- when:
|
||||||
suite: full
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_e2e_code_cov_report:
|
||||||
|
suite: full #add to full suite
|
||||||
- store_test_results:
|
- store_test_results:
|
||||||
path: test-results/results.xml
|
path: test-results/results.xml
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
@ -164,7 +184,11 @@ jobs:
|
|||||||
path: coverage
|
path: coverage
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
perf-test:
|
perf-test:
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
@ -180,7 +204,11 @@ jobs:
|
|||||||
path: test-results
|
path: test-results
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always run codecov reports regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
visual-test:
|
visual-test:
|
||||||
parameters:
|
parameters:
|
||||||
node-version:
|
node-version:
|
||||||
@ -196,7 +224,11 @@ jobs:
|
|||||||
path: test-results
|
path: test-results
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: html-test-results
|
path: html-test-results
|
||||||
- generate_and_store_version_and_filesystem_artifacts
|
- when:
|
||||||
|
condition:
|
||||||
|
equal: [ 42, 42 ] # Always generate version artifacts regardless of test failure https://discuss.circleci.com/t/make-custom-command-run-always-with-when-always/38957/2
|
||||||
|
steps:
|
||||||
|
- generate_and_store_version_and_filesystem_artifacts
|
||||||
workflows:
|
workflows:
|
||||||
overall-circleci-commit-status: #These jobs run on every commit
|
overall-circleci-commit-status: #These jobs run on every commit
|
||||||
jobs:
|
jobs:
|
||||||
@ -208,12 +240,12 @@ workflows:
|
|||||||
node-version: lts/hydrogen
|
node-version: lts/hydrogen
|
||||||
- e2e-test:
|
- e2e-test:
|
||||||
name: e2e-stable
|
name: e2e-stable
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
suite: stable
|
suite: stable
|
||||||
- perf-test:
|
- perf-test:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- visual-test:
|
- visual-test:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
|
|
||||||
the-nightly: #These jobs do not run on PRs, but against master at night
|
the-nightly: #These jobs do not run on PRs, but against master at night
|
||||||
jobs:
|
jobs:
|
||||||
@ -224,17 +256,17 @@ workflows:
|
|||||||
name: node18-chrome
|
name: node18-chrome
|
||||||
node-version: lts/hydrogen
|
node-version: lts/hydrogen
|
||||||
- npm-audit:
|
- npm-audit:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- e2e-test:
|
- e2e-test:
|
||||||
name: e2e-full-nightly
|
name: e2e-full-nightly
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
suite: full
|
suite: full
|
||||||
- perf-test:
|
- perf-test:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- visual-test:
|
- visual-test:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
- e2e-couchdb:
|
- e2e-couchdb:
|
||||||
node-version: lts/gallium
|
node-version: lts/hydrogen
|
||||||
triggers:
|
triggers:
|
||||||
- schedule:
|
- schedule:
|
||||||
cron: "0 0 * * *"
|
cron: "0 0 * * *"
|
||||||
|
@ -200,6 +200,7 @@ CircleCI
|
|||||||
Github Actions / Workflow
|
Github Actions / Workflow
|
||||||
|
|
||||||
- Full suite against all browsers/projects. Triggered with Github Label Event 'pr:e2e'
|
- Full suite against all browsers/projects. Triggered with Github Label Event 'pr:e2e'
|
||||||
|
- CouchDB Tests. Triggered on PR Create and again with Github Label Event 'pr:e2e:couchdb'
|
||||||
- Visual Tests. Triggered with Github Label Event 'pr:visual'
|
- Visual Tests. Triggered with Github Label Event 'pr:visual'
|
||||||
|
|
||||||
#### 3. Scheduled / Batch Testing
|
#### 3. Scheduled / Batch Testing
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
"test": "karma start",
|
"test": "karma start",
|
||||||
"test:debug": "KARMA_DEBUG=true karma start",
|
"test:debug": "KARMA_DEBUG=true karma start",
|
||||||
"test:e2e": "npx playwright test",
|
"test:e2e": "npx playwright test",
|
||||||
"test:e2e:couchdb": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome --grep @couchdb",
|
"test:e2e:couchdb": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome --grep @couchdb --workers=1",
|
||||||
"test:e2e:stable": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome --grep-invert \"@unstable|@couchdb\"",
|
"test:e2e:stable": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome --grep-invert \"@unstable|@couchdb\"",
|
||||||
"test:e2e:unstable": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome --grep @unstable",
|
"test:e2e:unstable": "npx playwright test --config=e2e/playwright-ci.config.js --project=chrome --grep @unstable",
|
||||||
"test:e2e:local": "npx playwright test --config=e2e/playwright-local.config.js --project=chrome",
|
"test:e2e:local": "npx playwright test --config=e2e/playwright-local.config.js --project=chrome",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user