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

Switched NODE_ENV to tests in CI #6831

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 32 additions & 30 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,8 @@ commands:
- run:
name: << parameters.label >>
command: make << parameters.target >> SPEC_FILES="<< parameters.spec_files >>"
environment:
- NODE_ENV: test
store_cypress_artifacts:
description: Store Cypress artifacts like screenshots and videos
steps:
Expand All @@ -253,34 +255,34 @@ workflows:
version: 2
datahub:
jobs:
- lint: *ignore_ghpages
- unit_tests: *ignore_ghpages
- unit_client_tests: *ignore_ghpages
# - lint: *ignore_ghpages
# - unit_tests: *ignore_ghpages
# - unit_client_tests: *ignore_ghpages
- functional_tests: *ignore_ghpages
- a11y_tests: *ignore_ghpages
- visual_tests: *ignore_ghpages
- visual_component_tests: *ignore_ghpages
- component_tests: *ignore_ghpages
- e2e_tests:
<<: *ignore_ghpages
name: e2e_tests_<< matrix.staff >>
matrix:
parameters:
staff: [da, lep]
- e2e_tests_dit:
<<: *ignore_ghpages
name: e2e_tests_dit
matrix:
parameters:
staff: [dit]
- release-storybook:
<<: *ignore_ghpages
filters:
branches:
only:
- main
- merge-and-publish-coverage:
<<: *ignore_ghpages
requires:
- functional_tests
- unit_tests
# - a11y_tests: *ignore_ghpages
# - visual_tests: *ignore_ghpages
# - visual_component_tests: *ignore_ghpages
# - component_tests: *ignore_ghpages
# - e2e_tests:
# <<: *ignore_ghpages
# name: e2e_tests_<< matrix.staff >>
# matrix:
# parameters:
# staff: [da, lep]
# - e2e_tests_dit:
# <<: *ignore_ghpages
# name: e2e_tests_dit
# matrix:
# parameters:
# staff: [dit]
# - release-storybook:
# <<: *ignore_ghpages
# filters:
# branches:
# only:
# - main
# - merge-and-publish-coverage:
# <<: *ignore_ghpages
# requires:
# - functional_tests
# - unit_tests
3 changes: 1 addition & 2 deletions docker-compose.base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ services:
# Required to test Data Hub roles in e2e tests, make sure this var
# doesn't exists in your .env file as the override below won't work
OAUTH2_DEV_TOKEN: ${OAUTH2_DEV_TOKEN:-ditStaffToken}
command: npm run develop

command: bash -c 'npm run build && npm start'
redis:
image: redis:6.2.6
2 changes: 1 addition & 1 deletion nodemon.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"ignore": ["*.test.js"],
"env": {
"NODE_ENV": "development"
"NODE_ENV": "test"
},
"ext": "js json"
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"start": "node --use-strict src/server.js",
"start:coverage": "nyc --silent npm run start",
"build": "npm run clean && webpack",
"develop": "NODE_ENV=development npm run watch:js:client -- --env development",
"develop": "NODE_ENV=test npm run watch:js:client -- --env test",
"watch:test": "npm run test:unit -- -w",
"watch:js:client": "webpack --watch --progress",
"watch:js:server": "nodemon $NODE_DEBUG_OPTION --inspect --ignore 'src/**/__test__/**/*'",
Expand Down
6 changes: 4 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const StartServerAfterBuild = () => {
server.stdin.write('rs\n')
} else {
server = spawn(
"npx nodemon --inspect --ignore 'src/**/__test__/**/*'",
// "npx nodemon --inspect --ignore 'src/**/__test__/**/*'",
"npm run start:coverage",
{ stdio: ['pipe', 'inherit', 'inherit'], shell: true }
)
}
Expand Down Expand Up @@ -88,7 +89,8 @@ module.exports = (env) => ({
},
},
}),
env && env.development ? StartServerAfterBuild() : null,
// env && env.development ? StartServerAfterBuild() : null,
StartServerAfterBuild(),
].filter(Boolean),
resolve: {
modules: [
Expand Down
Loading