File tree 9 files changed +403
-10
lines changed
src/main/java/io/opentelemetry/instrumentation/testreport
9 files changed +403
-10
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ for [`dependabot/**/**`](https://github.com/open-telemetry/community/blob/main/d
75
75
- Key is associated with [ @trask ] ( https://github.com/trask ) 's gmail address
76
76
- ` SONATYPE_KEY ` - owned by [ @trask ] ( https://github.com/trask )
77
77
- ` SONATYPE_USER ` - owned by [ @trask ] ( https://github.com/trask )
78
+ - ` FLAKY_TEST_REPORTER_ACCESS_KEY ` - owned by [ @laurit ] ( https://github.com/laurit )
78
79
79
80
### Organization secrets
80
81
Original file line number Diff line number Diff line change @@ -290,6 +290,36 @@ jobs:
290
290
if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
291
291
run : cat build-scan.txt
292
292
293
+ - name : Get current job url
294
+ id : jobs
295
+ if : ${{ !cancelled() }}
296
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
297
+ env :
298
+ matrix : ${{ toJson(matrix) }}
299
+ with :
300
+ result-encoding : string
301
+ script : |
302
+ const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
303
+ owner: context.repo.owner,
304
+ repo: context.repo.repo,
305
+ run_id: context.runId,
306
+ per_page: 100
307
+ });
308
+ const matrix = JSON.parse(process.env.matrix);
309
+ const job_name = `common / test${ matrix['test-partition'] } (${ matrix['test-java-version'] }, ${ matrix.vm })`;
310
+ return workflow_run.jobs.find((job) => job.name === job_name).html_url;
311
+
312
+ - name : Flaky test report
313
+ if : ${{ !cancelled() }}
314
+ env :
315
+ FLAKY_TEST_REPORTER_ACCESS_KEY : ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
316
+ JOB_URL : ${{ steps.jobs.outputs.result }}
317
+ run : |
318
+ if [ -s build-scan.txt ]; then
319
+ export BUILD_SCAN_URL=$(cat build-scan.txt)
320
+ fi
321
+ ./gradlew :test-report:reportFlakyTests
322
+
293
323
- name : Upload deadlock detector artifacts if any
294
324
if : failure()
295
325
uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
Original file line number Diff line number Diff line change @@ -10,19 +10,16 @@ jobs:
10
10
common :
11
11
uses : ./.github/workflows/build-common.yml
12
12
with :
13
- max-test-retries : 0
14
13
no-build-cache : true
15
14
16
15
test-latest-deps :
17
16
uses : ./.github/workflows/reusable-test-latest-deps.yml
18
17
with :
19
- max-test-retries : 0
20
18
no-build-cache : true
21
19
22
20
test-indy :
23
21
uses : ./.github/workflows/reusable-test-indy.yml
24
22
with :
25
- max-test-retries : 0
26
23
no-build-cache : true
27
24
28
25
# muzzle is not included here because it doesn't use gradle cache anyway and so is already covered
Original file line number Diff line number Diff line change 9
9
jobs :
10
10
common :
11
11
uses : ./.github/workflows/build-common.yml
12
- with :
13
- max-test-retries : 0
14
12
15
13
test-latest-deps :
16
14
uses : ./.github/workflows/reusable-test-latest-deps.yml
17
- with :
18
- max-test-retries : 0
19
15
20
16
test-indy :
21
17
uses : ./.github/workflows/reusable-test-indy.yml
22
- with :
23
- max-test-retries : 0
24
18
25
19
muzzle :
26
20
uses : ./.github/workflows/reusable-muzzle.yml
Original file line number Diff line number Diff line change 86
86
- name : Build scan
87
87
if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
88
88
run : cat build-scan.txt
89
+
90
+ - name : Get current job url
91
+ id : jobs
92
+ if : ${{ !cancelled() }}
93
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
94
+ env :
95
+ matrix : ${{ toJson(matrix) }}
96
+ with :
97
+ result-encoding : string
98
+ script : |
99
+ const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
100
+ owner: context.repo.owner,
101
+ repo: context.repo.repo,
102
+ run_id: context.runId,
103
+ per_page: 100
104
+ });
105
+ const matrix = JSON.parse(process.env.matrix);
106
+ const job_name = `test-indy / testIndy${ matrix['test-partition'] }`;
107
+ return workflow_run.jobs.find((job) => job.name === job_name).html_url;
108
+
109
+ - name : Flaky test report
110
+ if : ${{ !cancelled() }}
111
+ env :
112
+ FLAKY_TEST_REPORTER_ACCESS_KEY : ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
113
+ JOB_URL : ${{ steps.jobs.outputs.result }}
114
+ run : |
115
+ if [ -s build-scan.txt ]; then
116
+ export BUILD_SCAN_URL=$(cat build-scan.txt)
117
+ fi
118
+ ./gradlew :test-report:reportFlakyTests
Original file line number Diff line number Diff line change 85
85
if : ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
86
86
run : cat build-scan.txt
87
87
88
+ - name : Get current job url
89
+ id : jobs
90
+ if : ${{ !cancelled() }}
91
+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
92
+ env :
93
+ matrix : ${{ toJson(matrix) }}
94
+ with :
95
+ result-encoding : string
96
+ script : |
97
+ const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
98
+ owner: context.repo.owner,
99
+ repo: context.repo.repo,
100
+ run_id: context.runId,
101
+ per_page: 100
102
+ });
103
+ const matrix = JSON.parse(process.env.matrix);
104
+ const job_name = `test-latest-deps / testLatestDeps${ matrix['test-partition'] }`;
105
+ return workflow_run.jobs.find((job) => job.name === job_name).html_url;
106
+
107
+ - name : Flaky test report
108
+ if : ${{ !cancelled() }}
109
+ env :
110
+ FLAKY_TEST_REPORTER_ACCESS_KEY : ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
111
+ JOB_URL : ${{ steps.jobs.outputs.result }}
112
+ run : |
113
+ if [ -s build-scan.txt ]; then
114
+ export BUILD_SCAN_URL=$(cat build-scan.txt)
115
+ fi
116
+ ./gradlew :test-report:reportFlakyTests
117
+
88
118
- name : Upload deadlock detector artifacts if any
89
119
if : failure()
90
120
uses : actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
Original file line number Diff line number Diff line change @@ -54,7 +54,8 @@ develocity {
54
54
termsOfUseUrl.set(" https://gradle.com/help/legal-terms-of-use" )
55
55
termsOfUseAgree.set(" yes" )
56
56
57
- if (! gradle.startParameter.taskNames.contains(" listTestsInPartition" )) {
57
+ if (! gradle.startParameter.taskNames.contains(" listTestsInPartition" ) &&
58
+ ! gradle.startParameter.taskNames.contains(" :test-report:reportFlakyTests" )) {
58
59
buildScanPublished {
59
60
File (" build-scan.txt" ).printWriter().use { writer ->
60
61
writer.println (buildScanUri)
@@ -97,6 +98,7 @@ include(":instrumentation-annotations-support-testing")
97
98
98
99
// misc
99
100
include(" :dependencyManagement" )
101
+ include(" :test-report" )
100
102
include(" :testing:agent-exporter" )
101
103
include(" :testing:agent-for-testing" )
102
104
include(" :testing:armeria-shaded-for-testing" )
Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id(" otel.java-conventions" )
3
+ }
4
+
5
+ dependencies {
6
+ implementation(" com.google.api-client:google-api-client:2.7.1" )
7
+ implementation(" com.google.apis:google-api-services-sheets:v4-rev20250106-2.0.0" )
8
+ implementation(" com.google.auth:google-auth-library-oauth2-http:1.30.1" )
9
+ }
10
+
11
+ otelJava {
12
+ minJavaVersionSupported.set(JavaVersion .VERSION_17 )
13
+ }
14
+
15
+ tasks {
16
+ val reportFlakyTests by registering(JavaExec ::class ) {
17
+ dependsOn(classes)
18
+
19
+ mainClass.set(" io.opentelemetry.instrumentation.testreport.FlakyTestReporter" )
20
+ classpath(sourceSets[" main" ].runtimeClasspath)
21
+
22
+ systemProperty(" scanPath" , project.rootDir)
23
+ systemProperty(" googleSheetsAccessKey" , System .getenv(" FLAKY_TEST_REPORTER_ACCESS_KEY" ))
24
+ systemProperty(" buildScanUrl" , System .getenv(" BUILD_SCAN_URL" ))
25
+ systemProperty(" jobUrl" , System .getenv(" JOB_URL" ))
26
+ }
27
+ }
You can’t perform that action at this time.
0 commit comments