Skip to content

Commit

Permalink
debug for test splitting
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Florentine <[email protected]>
  • Loading branch information
jflo committed Nov 30, 2023
1 parent 01b2ad3 commit e253b88
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions .github/workflows/parallel-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,35 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Download Test Reports
uses: actions/download-artifact@v3
with:
name: junit-xml-reports
path: tmp/junit-xml-reports-downloaded
- name : Split Unit tests
uses: r7kamura/split-tests-by-timings@v0
id: split-tests
with:
reports: tmp/junit-xml-reports-downloaded
glob: '**/test-results/test/TEST-*.xml'
index: ${{ matrix.ci_node_index }}
total: 4
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
cache: gradle
- name: Build
uses: gradle/gradle-build-action@v2
with:
gradle-home-cache-cleanup: true
cache-read-only: false
arguments: compileJava compileTestJava -Dorg.gradle.parallel=true
- name: write out test list
run: echo "${{ steps.split-tests.outputs.paths }}" >> testList.txt
- name: debug testfile paths
run: cat testList.txt
- name: format gradle args
#regex means: first truncate file paths to align with package name, then swap path delimiter with package delimiter,
#then drop file extension, then insert --tests option between each.
run: cat testList.txt | sed -e 's@.*/src/test/java/@@g' -e 's@/@.@g' -e 's/\.java//g' -e 's/\ /\ --tests\ /g' >> gradleArgs.txt
- name debug test class list
- run: cat gradleArgs.txt
- name: run unit tests
run: ./gradlew test --tests `cat gradleArgs.txt`

0 comments on commit e253b88

Please sign in to comment.