I have a pipeline that do the following steps:
1. lint
2. test
3. collect coverage
If there is downgrade in one of the coverage rate it should block the PR.
otherwise it update the threshold and commit it to the already opened PR.
Sometimes although the pipeline is running and finish successfully to push back a commit with the new threshold it not show it anymore in the PR builds.
The pipeline is defined with the following steps:
- step:
name: Lint and Test
caches:
- node
script:
- npm ci
- npm run lint
- npm run test-coverage
- npm run update-coverage
after-script:
- git config --global user.email "ci-bot@duve.com"
- git config --global user.name "CI Bot"
- git add jest.config.json
- git commit -m "[skip ci] Updating test thresholds based on tests results"
- git push origin HEAD:$BITBUCKET_BRANCH
The project is written in js
The script `update-coverage` run a js code that finish with `process.exit(0);` is there is no errors on run time and `process.exit(1);` if there is any error