Skip to content
Snippets Groups Projects
Commit 7761e73a authored by Thong Kuah's avatar Thong Kuah
Browse files

Undercover uses merged results branch

= Because the coverage data was generated using the merged results branch,
checking undercoverage should also use the same branch.

- Fix git depth to fix changeset.rb:77:in `merge_base': object not found -
no match for id (Rugged::OdbError)
parent a77274d8
No related branches found
No related tags found
1 merge request!90330Undercover uses merged results branch
......@@ -606,17 +606,12 @@ rspec:undercoverage:
extends:
- .coverage-base
- .rails:rules:rspec-undercoverage
variables:
GIT_DEPTH: 200
stage: post-test
needs: ["rspec:coverage"]
script:
- if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then
echo "Checking out \$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ($CI_MERGE_REQUEST_SOURCE_BRANCH_SHA) instead of \$CI_COMMIT_SHA (merge result commit $CI_COMMIT_SHA) so we can use $CI_MERGE_REQUEST_DIFF_BASE_SHA for undercoverage in this merged result pipeline";
git checkout -f ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA};
bundle_install_script;
else
echo "Using \$CI_COMMIT_SHA ($CI_COMMIT_SHA) for this non-merge result pipeline.";
fi;
- UNDERCOVERAGE_COMPARE="${CI_MERGE_REQUEST_DIFF_BASE_SHA:-$(git merge-base origin/master HEAD)}"
- UNDERCOVERAGE_COMPARE="${CI_MERGE_REQUEST_TARGET_BRANCH_SHA:-$CI_MERGE_REQUEST_DIFF_BASE_SHA}"
- echo "Undercoverage comparing with ${UNDERCOVERAGE_COMPARE}"
- if [ -f scripts/undercoverage ]; then
run_timed_command "scripts/undercoverage ${UNDERCOVERAGE_COMPARE}";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment