-
Notifications
You must be signed in to change notification settings - Fork 1
UID2-3858 verify no of tests run #141
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 4 commits
a1ca4d2
dc4cc72
6bac3f5
9165378
709d546
837cba8
3a44684
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 |
|---|---|---|
|
|
@@ -59,6 +59,13 @@ jobs: | |
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Checkout uid2-shared-actions repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: kcc-UID2-3858-verify-no-of-tests-run | ||
|
||
| repository: IABTechLab/uid2-shared-actions | ||
| path: uid2-shared-actions | ||
|
|
||
| - name: Set up JDK | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
|
|
@@ -113,9 +120,11 @@ jobs: | |
|
|
||
| - name: Compile | ||
| if: ${{ inputs.publish_to_maven != true }} | ||
| env: | ||
| EXTRA_FLAGS: "-s settings.xml -Dgpg.passphrase=\"${{ secrets.GPG_PASSPHRASE }}\"" | ||
| run: | | ||
| cd ./${{ inputs.working_dir }} | ||
| mvn -B -s settings.xml -Dgpg.passphrase="${{ secrets.GPG_PASSPHRASE }}" clean compile test | ||
| bash uid2-shared-actions/scripts/compile_java_test_and_verify.sh | ||
|
|
||
| - name: Commit pom.xml and version.json | ||
| if: ${{ steps.checkRelease.outputs.is_release != 'true' }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| mvn -B $EXTRA_FLAGS clean compile test | tee build.log | ||
|
||
|
|
||
| tests_run=$(cat build.log | grep "Tests run:" | tail -n 1 | sed 's/.*Tests run: \([0-9]*\).*/\1/') | ||
|
|
||
| echo "DEBUG: tests_run = $tests_run" | ||
|
|
||
| if [ -z "$tests_run" ]; then | ||
| echo "WARNING: Could not determine the number of tests run." | ||
| tests_run=0 | ||
|
||
| fi | ||
|
|
||
| if [ "$tests_run" -eq 0 ]; then | ||
| echo "ERROR: No tests were run!" | ||
| exit 1 | ||
|
||
| fi | ||
|
|
||
| echo "INFO: $tests_run tests were run!" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to v3 before merging
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the checkout of the repo necessary? Is it possible to use a reusable workflow instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was required for testing. Keep it here as Abu is doing some refactoring laster on so that we don't need to specify the branch name every where when we are testing in the future.