Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore][codecov] Fix coverage file naming #39356

Merged
merged 7 commits into from
Apr 14, 2025

Conversation

crobert-1
Copy link
Member

Description

Uploads to codecov have been broken since #37875 was merged. Efforts have been made to address the reasoning behind why it's not working (eg #38236), but it's still failing.

Example recent failure:

Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded.

This failure is hit here.

This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.

@crobert-1 crobert-1 marked this pull request as ready for review April 14, 2025 15:18
@crobert-1 crobert-1 requested a review from a team as a code owner April 14, 2025 15:18
@crobert-1 crobert-1 requested a review from mx-psi April 14, 2025 15:18
Makefile.Common Outdated
@@ -18,7 +21,7 @@ GOTEST_TIMEOUT?= 600s
GOTEST_OPT?= -race -timeout $(GOTEST_TIMEOUT) -parallel 4 --tags=$(GO_BUILD_TAGS)
GOTEST_INTEGRATION_OPT?= -race -timeout 360s -parallel 4 -skip Sudo
GOTEST_INTEGRATION_OPT_SUDO?= -race -timeout 360s -parallel 4 -exec sudo -run Sudo
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -coverprofile=coverage.txt -covermode=atomic
GOTEST_OPT_WITH_COVERAGE = $(GOTEST_OPT) -covermode=atomic -test.gocoverdir="$(COVER_DIR_ABS)"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two changes going on here:

  1. Do not set -coverprofile: This sets the output filename of the code coverage results. We want a random name so they are not clobbered when moving them into the same location.
  2. Add the -test.gocoverdir option: This means all code coverage files will be in the same directory, making it simpler to generate the final merged report.

Makefile Outdated
@@ -186,6 +186,7 @@ gotest-with-junit:
.PHONY: gotest-with-junit-and-cover
gotest-with-junit-and-cover:
@$(MAKE) $(FOR_GROUP_TARGET) TARGET="test-with-junit-and-cover"
@go tool covdata textfmt -i=$(COVER_DIR_ABS) -o coverage.txt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change means all coverage files located in the coverage directory will be merged into a single file, which can then be uploaded by the workflow.

@songy23 songy23 added the ci-cd CI, CD, testing, build issues label Apr 14, 2025
@crobert-1
Copy link
Member Author

Copy link
Member Author

@crobert-1 crobert-1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add back codecov running restrictions since the testing showed the upload is working.

@songy23 songy23 merged commit b7de50f into open-telemetry:main Apr 14, 2025
171 checks passed
@github-actions github-actions bot added this to the next release milestone Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-cd CI, CD, testing, build issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants