From 9b08b7e27aaf39d8b5e97e7db03a2db4c27a0045 Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Thu, 5 Sep 2024 21:39:25 +0100 Subject: [PATCH] fix_: docker volumes --- _assets/scripts/run_integration_tests.sh | 35 ++++++++++--------- .../docker-compose.test.status-go.yml | 4 +-- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/_assets/scripts/run_integration_tests.sh b/_assets/scripts/run_integration_tests.sh index 86311330c..714358758 100755 --- a/_assets/scripts/run_integration_tests.sh +++ b/_assets/scripts/run_integration_tests.sh @@ -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 diff --git a/integration-tests/docker-compose.test.status-go.yml b/integration-tests/docker-compose.test.status-go.yml index 700cee8e9..a5ab02f81 100644 --- a/integration-tests/docker-compose.test.status-go.yml +++ b/integration-tests/docker-compose.test.status-go.yml @@ -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}