From 77dc28a5c349f1a544fee93ddc55142bc1fca1ea Mon Sep 17 00:00:00 2001 From: Justin Florentine Date: Wed, 29 Nov 2023 15:30:16 -0500 Subject: [PATCH] lets run the unit tests before trying to shard them Signed-off-by: Justin Florentine --- .github/workflows/unit-tests.yml | 37 +++++--------------------------- 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 475e3b641d6..1450da99894 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -13,15 +13,6 @@ jobs: runs-on: group: "Besu Large Runners" name: Generate runner indexes - outputs: - json: ${{ steps.generate-index-list.outputs.json }} - steps: - - id: generate-index-list - run: | - MAX_INDEX=$((${{ env.total-runners }}-1)) - INDEX_LIST=$(seq 0 ${MAX_INDEX}) - INDEX_JSON=$(jq --null-input --compact-output '. |= [inputs]' <<< ${INDEX_LIST}) - echo "::set-output name=json::${INDEX_JSON}" unitTests: runs-on: group: "Besu Large Runners" @@ -47,36 +38,18 @@ jobs: with: gradle-home-cache-cleanup: true cache-read-only: false - arguments: compileJava compileTestJava -Dorg.gradle.parallel=true - - name: Split tests - id: split-tests - uses: chaosaffe/split-tests@v1-alpha.1 - with: - glob: '**/src/test/java/**/*Test.java' - split-total: ${{ env.total-runners }} - split-index: ${{ matrix.runner-index }} - - - name: write out test list - run: echo "${{ steps.split-tests.outputs.test-suite }}" >> 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: run unit tests - run: ./gradlew test --tests `cat gradleArgs.txt` - - name: cleanup tempfiles - run: rm testList.txt gradleArgs.txt + arguments: build -Dorg.gradle.parallel=true - name: Upload Unit Test Report uses: actions/upload-artifact@v3 if: always() # always run even if the previous step fails with: name: junit-unit-${{ matrix.runner-index }}-test-results path: '**/test-results/test/TEST-*.xml' - retention-days: 1 - - name: Acceptance Test Report html + retention-days: 10 + - name: Unit Test Report html uses: actions/upload-artifact@v3 if: always() # always run even if the previous step fails with: - name: html-acceptance-${{ matrix.runner-index }}-test-results + name: html-unit-${{ matrix.runner-index }}-test-results path: '**/build/reports/tests/test/**' - retention-days: 1 + retention-days: 10