Fix conditionals that trigger Artifact upload#38236
Conversation
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
| if: startsWith( matrix.go-version, '1.23' ) # only run junit/coverage on one version | ||
| if: startsWith( matrix.go-version, '~1.23' ) # only run junit/coverage on one version | ||
| run: make gotest-with-junit-and-cover GROUP=${{ matrix.group }} | ||
| - uses: actions/upload-artifact@v4 | ||
| if: startsWith( matrix.go-version, '1.23' ) # only upload artifact for one version | ||
| if: startsWith( matrix.go-version, '~1.23' ) # only upload artifact for one version | ||
| with: | ||
| name: coverage-artifacts-${{ matrix.go-version }}-${{ matrix.runner }}-${{ matrix.group }} | ||
| path: ${{ matrix.group }}-coverage.txt | ||
| - uses: actions/upload-artifact@v4 | ||
| if: startsWith( matrix.go-version, '1.23' ) # only upload artifact for one version | ||
| if: startsWith( matrix.go-version, '~1.23' ) # only upload artifact for one version |
There was a problem hiding this comment.
@mx-psi @songy2, the problem was that the tilde was missing in the previous PRs. You can check this workflow that ran from the first commit: https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/13552199813/job/37878313056?pr=38236
There's one step called Debug startWith Condition that shows what's expected
There was a problem hiding this comment.
btw you tagged the wrong person :)))
| @@ -289,15 +289,15 @@ jobs: | |||
| if: startsWith( matrix.go-version, '1.23' ) != true | |||
There was a problem hiding this comment.
Related to the comment above, what do we want to do with this part specifically? Currently we're running tests in both go versions, is that the intended behavior? Should we be testing only with go 1.23? go 1.24?
There was a problem hiding this comment.
We should be testing both versions, that looks a bit weird yep https://github.com/open-telemetry/opentelemetry-collector?tab=readme-ov-file#compatibility
There was a problem hiding this comment.
Ok, I'll just remove that conditional then... Just creates confusion
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
ce755e3 to
26e86e0
Compare
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
|
I still want to make the two steps running tests mutually exclusive. I'm not sure if it's worth running a 1h long test execution on every PR if we're not using the JUnit artifacts on every PR |
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
That makes sense to me 👍 will wait to merge this until Yang has reviewed and you feel ready for it |
Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Should be ok from my side |
|
All good from my end, let me know when you would like to merge 🚀 |
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### 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:](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14409354807/job/40413708600) ``` Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded. ``` This failure is hit [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/2e35cae16745dab737e1d0bf636119b4c669c9cd/.github/workflows/build-and-test.yml#L305). This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Uploads to codecov have been broken since open-telemetry#37875 was merged. Efforts have been made to address the reasoning behind why it's not working (eg open-telemetry#38236), but it's still failing. [Example recent failure:](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14409354807/job/40413708600) ``` Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded. ``` This failure is hit [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/2e35cae16745dab737e1d0bf636119b4c669c9cd/.github/workflows/build-and-test.yml#L305). This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.
#### Description Now that we're uploading files correctly (#38236), this PR extends the current unit test workflow to download the artifacts and calling issuegenerator to create the issues. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Related to #36761 Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Uploads to codecov have been broken since open-telemetry#37875 was merged. Efforts have been made to address the reasoning behind why it's not working (eg open-telemetry#38236), but it's still failing. [Example recent failure:](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/14409354807/job/40413708600) ``` Warning: No files were found with the provided path: receiver-0-coverage.txt. No artifacts will be uploaded. ``` This failure is hit [here](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/2e35cae16745dab737e1d0bf636119b4c669c9cd/.github/workflows/build-and-test.yml#L305). This PR aims to correct the naming and location of code coverage files to enable the successful upload to codecov.
|
CodeCov report on PR seems unavailable after this change. Is this expected behavior? |


Description
After the revert done in #38230 and #38231, I'm looking yet again on what went wrong there.
I'm solving this in small parts, and this PR focuses on ensuring JUnit Artifacts are uploaded correctly.
Link to tracking issue
Still related to #36761
Testing
I plan to test this by looking at the artifacts produced in this PR. The JUnit files need to be there. See https://github.com/actions/upload-artifact?tab=readme-ov-file#where-does-the-upload-go