Skip to content

Commit c706f2b

Browse files
bric3sarahchen6
andauthored
Tests summary in pipeline and improved test tags to be used in Test Optimization product (#10530)
* build: Count ran tests * build: Don't include check jobs * build: Refactor with functions * chore: Remove verbose output * chore: Add a breakdown by JVM and test job kind * chore: Contribute DD tags for test jobs * chore: Contribute DD tags for test jobs (2) * chore: Do not cat markdown report unless `-v` is passed * fix: Array-based tags for tag propagation * chore: Debug log * chore: Sort breakdown * chore: after script is executed in a different shell and don't see env var in before script * chore: collect data in upload_ciapp.sh directly * fix: Test counting now counts testcase element * chore: Rename stage to test-summary * chore: Improves a bit the readability * chore: Removes markdown report --------- Co-authored-by: Sarah Chen <[email protected]>
1 parent 63b528a commit c706f2b

5 files changed

Lines changed: 696 additions & 0 deletions

File tree

.gitlab-ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ stages:
1212
- benchmarks
1313
- macrobenchmarks
1414
- tests
15+
- test-summary
1516
- exploration-tests
1617
- ci-visibility-tests
1718
- generate-signing-key
@@ -610,6 +611,7 @@ muzzle-dep-report:
610611
- .gitlab/collect_results.sh
611612
- .gitlab/upload_ciapp.sh $CACHE_TYPE $testJvm
612613
- gitlab_section_end "collect-reports"
614+
- .gitlab/count_tests.sh "$GRADLE_TARGET" "$testJvm" "./results" "./test_counts_${CI_JOB_ID}.json"
613615
- URL_ENCODED_JOB_NAME=$(jq -rn --arg x "$CI_JOB_NAME" '$x|@uri')
614616
- echo -e "${TEXT_BOLD}${TEXT_YELLOW}See test results in Datadog:${TEXT_CLEAR} https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.service%3Add-trace-java%20%40ci.pipeline.id%3A${CI_PIPELINE_ID}%20%40ci.job.name%3A%22${URL_ENCODED_JOB_NAME}%22"
615617
artifacts:
@@ -618,6 +620,7 @@ muzzle-dep-report:
618620
- ./reports.tar
619621
- ./profiles.tar
620622
- ./results
623+
- './test_counts_*.json'
621624
- '.gradle/daemon/*/*.out.log'
622625
reports:
623626
junit: results/*.xml
@@ -790,6 +793,25 @@ test_smoke_semeru8_debugger:
790793
NON_DEFAULT_JVMS: "true"
791794
testJvm: "semeru8"
792795

796+
aggregate_test_counts:
797+
image: ghcr.io/datadog/dd-trace-java-docker-build:${BUILDER_IMAGE_VERSION_PREFIX}base
798+
stage: test-summary
799+
# Note: No explicit 'needs' or 'dependencies' required
800+
# By default, GitLab CI automatically downloads artifacts from ALL jobs in previous stages
801+
# This job collects test_counts_*.json files from all test/check jobs via stage ordering
802+
rules:
803+
- if: '$POPULATE_CACHE'
804+
when: never
805+
- when: always
806+
script:
807+
- *set_datadog_api_keys
808+
- .gitlab/aggregate_test_counts.sh
809+
artifacts:
810+
when: always
811+
paths:
812+
- test_counts_summary.json
813+
- test_counts_report.md
814+
793815
deploy_to_profiling_backend:
794816
stage: publish
795817
needs: [ build ]

0 commit comments

Comments
 (0)