Closed prasadtalasila closed 1 week ago
@VanessaScherma
The following modifications to client/package.json
shall simplify the coverage data collection.
"test:coverage:int-unit": "npx istanbul-combine -d coverage/all -r lcov -r json -r text coverage/unit/coverage-final.json coverage/int/coverage-final.json coverage/preview/unit/coverage-final.json coverage/preview/int/coverage-final.json",
"test:int": "jest -c ./jest.config.json jest --coverage --coverageDirectory=coverage/int ../test/integration --setupFilesAfterEnv ./test/integration/jest.setup.ts",
"test:unit": "jest -c ./jest.config.json --coverageDirectory=coverage/unit ../test/unit --setupFilesAfterEnv ./test/unit/jest.setup.ts",
"test:preview:int": "jest -c ./jest.config.json --coverageDirectory=coverage/preview/int ../test/preview/integration --setupFilesAfterEnv ./test/preview/integration/jest.setup.ts",
"test:preview:unit": "jest -c ./jest.config.json --coverageDirectory=coverage/preview/unit ../test/preview/unit --setupFilesAfterEnv ./test/preview/unit/jest.setup.ts"
In addition, with the suggested modifications, there is no need to modify client/eslint.config.mjs
file.
This is completed in PR #1005
Describe the bug
The testing of
client/
code is fragmented over fouryarn
commands. Thus a complete overview of test coverage is not available for clientTo Reproduce
Steps to reproduce the behavior:
client
Each of them produces coverage reports and places them in
coverage/
directory. The existing contents ofcoverage/
directory get overwritten.Expected behavior
These
yarn
commands produce a consolidated code coverage report even if they are run separately.Solution
The solution is to run them separately. Save the test reports into a dedicated directory and then consolidate the reports into a single report. It is possible using the following commands.
Additional Context
It would be nice to set the target directory for each of the yarn test:* commands so that the move commands themselves can be discarded.
This consolidation needs to happen both at developer computer and Github Actions.