From e253b88a2c352091c02a64ac413851080a885420 Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Thu, 30 Nov 2023 10:52:19 -0500 Subject: [PATCH] debug for test splitting Signed-off-by: Justin Florentine --- .github/workflows/parallel-unit-tests.yml | 32 ++++++++++++++++++----- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/.github/workflows/parallel-unit-tests.yml b/.github/workflows/parallel-unit-tests.yml index 092851f89c1..8e04470cf4d 100644 --- a/.github/workflows/parallel-unit-tests.yml +++ b/.github/workflows/parallel-unit-tests.yml @@ -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` +