-
Notifications
You must be signed in to change notification settings - Fork 588
HDDS-12587. Detect test class module in flaky-test-check #8162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,6 +61,9 @@ env: | |
| RATIS_REPO: ${{ github.event.inputs.ratis-repo }} | ||
| RATIS_VERSION: ${{ github.event.inputs.ratis-ref }} | ||
| JAVA_VERSION: ${{ github.event.inputs.java-version }} | ||
| # Surefire 3.0.0-M4 is used because newer versions do not reliably kill the fork on timeout | ||
| # SUREFIRE-1722, SUREFIRE-1815 | ||
| SUREFIRE_VERSION: 3.0.0-M4 | ||
| run-name: ${{ github.event_name == 'workflow_dispatch' && format('{0}#{1}[{2}]-{3}x{4}-java{5}', inputs.test-class, inputs.test-name, inputs.ref, inputs.splits, inputs.iterations, inputs.java-version) || '' }} | ||
| jobs: | ||
| prepare-job: | ||
|
|
@@ -87,11 +90,54 @@ jobs: | |
| with: | ||
| repo: ${{ github.event.inputs.ratis-repo || format('{0}/ratis', github.repository_owner) }} | ||
| ref: ${{ github.event.inputs.ratis-ref }} | ||
| find-tests: | ||
| if: ${{ always() }} | ||
| needs: | ||
| - prepare-job | ||
| runs-on: ubuntu-24.04 | ||
| outputs: | ||
| modules: ${{ steps.modules.outputs.modules }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.inputs.ref }} | ||
| - name: Cache for maven dependencies | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: | | ||
| ~/.m2/repository/*/*/* | ||
| !~/.m2/repository/org/apache/ozone | ||
| key: maven-repo-${{ hashFiles('**/pom.xml') }} | ||
| restore-keys: | | ||
| maven-repo- | ||
| - name: Setup java | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'temurin' | ||
| java-version: 8 | ||
| - name: Find tests | ||
| run: | | ||
| # find tests to be run in splits by running them with very short timeout | ||
| hadoop-ozone/dev-support/checks/junit.sh -DexcludedGroups="native|slow|unhealthy" -DskipShade \ | ||
| -Dtest="$TEST_CLASS,Abstract*Test*\$*" \ | ||
| -Dsurefire.fork.timeout=1 -Dmaven-surefire-plugin.version=${{ env.SUREFIRE_VERSION }} \ | ||
| || true # ignore errors | ||
| env: | ||
| ITERATIONS: 1 | ||
| - name: Find modules | ||
| id: modules | ||
| run: | | ||
| grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' target/unit/output.log | grep -B1 'Running org.apache' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is target/unit/output.log populated even before the test run?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I checked too but couldn't find better. Even if it is not able to write within 1 sec due to any issue, it will fallback to building all modules which is what happens today so I guess it should be okay. |
||
| modules=$(grep -e 'surefire:${{ env.SUREFIRE_VERSION }}:test' -e 'Running org.apache' target/unit/output.log | grep -B1 'Running org.apache' \ | ||
| | grep surefire | cut -f2 -d'@' | awk '{ print $1 }' | sed 's/^/:/' | xargs | sed -e 's/ /,/g') | ||
| echo "modules=$modules" >> $GITHUB_OUTPUT | ||
| if: ${{ !cancelled() }} | ||
| build: | ||
| if: ${{ always() }} | ||
| needs: | ||
| - prepare-job | ||
| - ratis | ||
| - find-tests | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 60 | ||
| steps: | ||
|
|
@@ -129,6 +175,10 @@ jobs: | |
| args="$args -Dgrpc.protobuf-compile.version=${{ needs.ratis.outputs.protobuf-version }}" | ||
| fi | ||
|
|
||
| if [[ -n "${{ needs.find-tests.outputs.modules }}" ]]; then | ||
| args="$args -am -pl ${{ needs.find-tests.outputs.modules }}" | ||
| fi | ||
|
|
||
| hadoop-ozone/dev-support/checks/build.sh $args | ||
| - name: Store Maven repo for tests | ||
| uses: actions/upload-artifact@v4 | ||
|
|
@@ -143,6 +193,7 @@ jobs: | |
| - prepare-job | ||
| - ratis | ||
| - build | ||
| - find-tests | ||
| name: Run-Split | ||
| runs-on: ubuntu-24.04 | ||
| strategy: | ||
|
|
@@ -197,6 +248,10 @@ jobs: | |
| args="$args -Dgrpc.protobuf-compile.version=${{ needs.ratis.outputs.protobuf-version }}" | ||
| fi | ||
|
|
||
| if [[ -n "${{ needs.find-tests.outputs.modules }}" ]]; then | ||
| args="$args -pl ${{ needs.find-tests.outputs.modules }}" | ||
| fi | ||
|
|
||
| if [ "$TEST_METHOD" = "ALL" ]; then | ||
| echo "Running all tests from $TEST_CLASS" | ||
| set -x | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.