[chore] Create gotest-with-junit Makefile target#11963
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #11963 +/- ##
=======================================
Coverage 91.62% 91.62%
=======================================
Files 447 447
Lines 23731 23739 +8
=======================================
+ Hits 21743 21751 +8
Misses 1613 1613
Partials 375 375 ☔ View full report in Codecov by Sentry. |
mx-psi
left a comment
There was a problem hiding this comment.
@ankitpatel96 can you add more on how you plan to use the artifacts?
Also I wonder if these should be uploaded https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/storing-and-sharing-data-from-a-workflow ?
ArthurSens
left a comment
There was a problem hiding this comment.
LGTM!
We get one JUnit file per go module, it should be possible to correlate files with codeowners :)
|
I've added a test to receiver/xreceiver: func TestFailure(t *testing.T) {
t.Fail()
}Then run the new command and got this XML output: <?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="2" failures="1" errors="0" time="1.835537">
<testsuite tests="2" failures="1" time="0.660000" name="go.opentelemetry.io/collector/receiver/xreceiver" timestamp="2024-12-20T11:01:25-03:00">
<properties>
<property name="go.version" value="go1.23.1 darwin/arm64"></property>
</properties>
<testcase classname="go.opentelemetry.io/collector/receiver/xreceiver" name="TestFailure" time="0.000000">
<failure message="Failed" type="">=== RUN TestFailure
--- FAIL: TestFailure (0.00s)
</failure>
</testcase>
<testcase classname="go.opentelemetry.io/collector/receiver/xreceiver" name="TestNewFactoryWithProfiles" time="0.000000"></testcase>
</testsuite>
</testsuites>From this file I get good information that I can re-use in automation:
Module names can be correlated to the codeowners file so we can ping the relevant people :) |
ArthurSens
left a comment
There was a problem hiding this comment.
Oh, actually there's one thing left to do. We probably want to add the test results path to .gitignore
Great point! Added a comment about how I / our company plans to use them.
Good idea... I will implement that. Even though no one uses these right now the extra time taken should be pretty minimal |
|
contrib test failures are due to #11932 |
|
Have to update this - the output path was wrong |
|
The artifact is basically a zip with the following list of files: This is ready to be merged |
mx-psi
left a comment
There was a problem hiding this comment.
Re-approving, I am going to merge this since this would also be useful for open-telemetry/opentelemetry-collector-contrib/issues/36761 which has a lot of support
Mimicking open-telemetry/opentelemetry-collector#11963 This effort is related to #36761. We'll need JUnit test results so issuegenerator(being worked on this PR: open-telemetry/opentelemetry-go-build-tools#672) can generate issues based on failing tests on main. cc @mx-psi Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Creates a target to output junit files from testing. This PR also starts to use it in CI - we don't consume the Junits yet but it would be easy to add on. This will be useful for a number of CI/Devx initiatives in the future.
My company, Datadog, plans to use this information to track the build stability of our code in contrib, as well as the stability of code we depend on here in collector.