-
-
Notifications
You must be signed in to change notification settings - Fork 216
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
Gradle CI doesn't launch unit tests #11513
Comments
@fabienpuissant : I looked at a random > Task :test
JwtReaderTest > should not authenticate user from empty token STANDARD_OUT
2024-12-05T23:23:09.354Z INFO --- [ Test worker] t.j.f.s.a.i.primary.JwtReader : Invalid empty JWT token
JwtReaderTest > should not authenticate user from blank token STANDARD_OUT
2024-12-05T23:23:09.359Z INFO --- [ Test worker] t.j.f.s.a.i.primary.JwtReader : Invalid empty JWT token
JwtReaderTest > should not authenticate user from invalid token STANDARD_OUT
2024-12-05T23:23:09.481Z INFO --- [ Test worker] t.j.f.s.a.i.primary.JwtReader : Invalid JWT token
2024-12-05T23:23:09.482Z TRACE --- [ Test worker] t.j.f.s.a.i.primary.JwtReader : Invalid JWT token: Invalid compact JWT string: Compact JWSs must contain exactly 2 period characters, and compact JWEs must contain exactly 4. Found: 0 Here is the part of the - name: 'Test: verify ${{ matrix.app }}'
if: steps.tests-requirement-check.outputs.execute_tests == 'true'
working-directory: /tmp/jhlite/${{ matrix.app }}/
run: |
if [ -f 'mvnw' ]; then
./mvnw clean verify -Dsonar.qualitygate.wait=true sonar:sonar
elif [ -f 'gradlew' ]; then
./gradlew clean build sonar --no-daemon --info
else
npm install
npm test
fi Please, could you provide an example that reproduces the not desired behavior? |
@renanfranca It's on a generated app See https://github.com/fabienpuissant/test-jh-lite-gradle-ci/actions/runs/12202622941 should fail because of : https://github.com/fabienpuissant/test-jh-lite-gradle-ci/blob/main/src/test/java/com/mycompany/myapp/FailingTest.java In the test-ci for jhlite it seems to be ok 😄 |
@fabienpuissant : Ohh, thanks! I see now. Today, if you add the To work out of the box without Jacoco, it is going need to change the Gradle module to directly link unit and integration tests. Then, when adding Jacoco, remove that link to make Jacoco the glue. @pascalgrimaud and @murdos : can you share your opinion here, please? About which is the best approach. |
Not 100% sure just on my mobile, but with the soft ordering should run after for the integration test phase this does not define a dependency. So when just executing integrationtest this does not imply running unit tests. In the ci config running unit and integration tests in dedicated phases should be fine. I would not do the clean before such that integration tests can use e.g.the compiled classes which have been created already before. |
@fabienpuissant : I think your solution is better and more flexible 😉. Even if we add the Jacoco module, the CI configuration will need to be updated to execute Jacoco instead of the IntegrationTest task. IMHO, If you want, feel free to proceed with the implementation—if not, I can take care of it on Monday 👍. Thanks for reporting that improvement/bug!
👆👆👆 cc: @pascalgrimaud , @murdos and @atomfrede |
It seems that the gradle ci don't launch unit test only IT.
I have tried to put a failing unit test and the ci was green
Is this the behaviour or a misconfiguration on my side ?
A possible working solution
github-actions.yml
The text was updated successfully, but these errors were encountered: