fix_: docker volumes

This commit is contained in:
Igor Sirotin 2024-09-05 21:39:25 +01:00
parent 4ae7b1fbd0
commit 9b08b7e27a
No known key found for this signature in database
GPG Key ID: 425E227CAAB81F95
2 changed files with 20 additions and 19 deletions

View File

@ -6,9 +6,11 @@ source "${GIT_ROOT}/_assets/scripts/codecov.sh"
root_path=./integration-tests
coverage_reports_path="${root_path}/coverage"
test_results_path="${root_path}/reports"
# Cleanup any previous coverage reports
rm -rf ${coverage_reports_path}
rm -rf ${test_results_path}
# Run integration tests
echo -e "${GRN}Running integration tests${RST}, HEAD: $(git rev-parse HEAD)"
@ -39,23 +41,22 @@ if [[ "$exit_code" -ne 0 ]]; then
exit $exit_code
fi
# Report to Codecov
# Prepare coverage reports
binary_coverage_reports_path="${coverage_reports_path}/binary"
merged_coverage_reports_path="${coverage_reports_path}/merged"
full_coverage_profile="${coverage_reports_path}/coverage.out"
# Clean merged reports directory
mkdir -p ${merged_coverage_reports_path}
# Merge coverage reports
go tool covdata merge -i=${binary_coverage_reports_path} -o=${merged_coverage_reports_path}
# Convert coverage reports to profile
go tool covdata textfmt -i=${merged_coverage_reports_path} -o=${full_coverage_profile}
# Upload reports to Codecov
if [[ ${INTEGRATION_TESTS_REPORT_CODECOV} == 'true' ]]; then
# Docs: https://go.dev/blog/integration-test-coverage
binary_coverage_reports_path="${coverage_reports_path}/binary"
merged_coverage_reports_path="${coverage_reports_path}/merged"
full_coverage_profile="${coverage_reports_path}/coverage.out"
test_results_path="${root_path}/reports"
# Clean merged reports directory
mkdir -p ${merged_coverage_reports_path}
# Merge coverage reports
go tool covdata merge -i=${binary_coverage_reports_path} -o=${merged_coverage_reports_path}
# Convert coverage reports to profile
go tool covdata textfmt -i=${merged_coverage_reports_path} -o=${full_coverage_profile}
# Upload reports to Codecov
# Docs: https://go.dev/blog/integration-test-coverage
report_to_codecov "${test_results_path}/*.xml" "${full_coverage_profile}" "integration"
fi

View File

@ -18,7 +18,7 @@ services:
environment:
GOCOVERDIR: "./coverage/binary"
volumes:
- ./coverage:/coverage
- ./coverage/binary:/coverage/binary
# TODO: Remove this duplication when implemented: https://github.com/status-im/status-go/issues/5803
status-go-no-funds:
@ -40,7 +40,7 @@ services:
environment:
GOCOVERDIR: "/coverage/binary"
volumes:
- ./coverage:/coverage
- ./coverage/binary:/coverage/binary
tests-rpc:
user: ${INTEGRATION_TESTS_DOCKER_UID}