generator-jhipster: Ci-Cd Jenkins - Frontend tests finally stage does not work : No result on reports !
Overview of the issue
Tested on jHipster 5.0.1, on a fresh install and a freshly generated Jenkinfiles.
The “Frontend tests” crashes on Jenkins with the following error :
ERROR: Aucun des rapports de test ne contient de résultat
Jenkinsfile :
stage('frontend tests') {
try {
bat "mvnw com.github.eirslett:frontend-maven-plugin:yarn -Dfrontend.yarn.arguments=test"
} catch(err) {
throw err
} finally {
junit '**/target/test-results/jest/TESTS-*.xml'
}
}
(Note that I’m on Windows…)
target\test-results\jest\TESTS-results.xml on my workspace :
<?xml version="1.0" encoding="UTF-8"?>
<testExecutions version="1">
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\shared\login\login.component.spec.ts">
<testCase name="Component Tests LoginComponent should authenticate the user upon login when previous state was set" duration="123"/>
<testCase name="Component Tests LoginComponent should authenticate the user upon login when previous state was not set" duration="26"/>
<testCase name="Component Tests LoginComponent should empty the credentials upon cancel" duration="25"/>
<testCase name="Component Tests LoginComponent should redirect user when register" duration="21"/>
<testCase name="Component Tests LoginComponent should redirect user when request password" duration="26"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\health\health.component.spec.ts">
<testCase name="Component Tests JhiHealthCheckComponent baseName and subSystemName should return the basename when it has no sub system" duration="205"/>
<testCase name="Component Tests JhiHealthCheckComponent baseName and subSystemName should return the basename when it has sub systems" duration="31"/>
<testCase name="Component Tests JhiHealthCheckComponent baseName and subSystemName should return the sub system name" duration="18"/>
<testCase name="Component Tests JhiHealthCheckComponent baseName and subSystemName should return the subsystem when it has multiple keys" duration="17"/>
<testCase name="Component Tests JhiHealthCheckComponent transformHealthData should flatten empty health data" duration="19"/>
<testCase name="Component Tests JhiHealthCheckComponent should flatten health data with no subsystems" duration="19"/>
<testCase name="Component Tests JhiHealthCheckComponent should flatten health data with subsystems at level 1, main system has no additional information" duration="27"/>
<testCase name="Component Tests JhiHealthCheckComponent should flatten health data with subsystems at level 1, main system has additional information" duration="18"/>
<testCase name="Component Tests JhiHealthCheckComponent should flatten health data with subsystems at level 1, main system has additional error" duration="15"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\password-reset\finish\password-reset-finish.component.spec.ts">
<testCase name="Component Tests PasswordResetFinishComponent should define its initial state" duration="36"/>
<testCase name="Component Tests PasswordResetFinishComponent sets focus after the view has been initialized" duration="24"/>
<testCase name="Component Tests PasswordResetFinishComponent should ensure the two passwords entered match" duration="37"/>
<testCase name="Component Tests PasswordResetFinishComponent should update success to OK after resetting password" duration="21"/>
<testCase name="Component Tests PasswordResetFinishComponent should notify of generic error" duration="19"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\register\register.component.spec.ts">
<testCase name="Component Tests RegisterComponent should ensure the two passwords entered match" duration="35"/>
<testCase name="Component Tests RegisterComponent should update success to OK after creating an account" duration="25"/>
<testCase name="Component Tests RegisterComponent should notify of user existence upon 400/login already in use" duration="27"/>
<testCase name="Component Tests RegisterComponent should notify of email existence upon 400/email address already in use" duration="16"/>
<testCase name="Component Tests RegisterComponent should notify of generic error" duration="19"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\audits\audits.component.spec.ts">
<testCase name="Component Tests AuditsComponent today function should set toDate to current date" duration="36"/>
<testCase name="Component Tests AuditsComponent previousMonth function should set fromDate to current date" duration="30"/>
<testCase name="Component Tests AuditsComponent By default, on init should set all default values correctly" duration="27"/>
<testCase name="Component Tests AuditsComponent OnInit Should call load all on init" duration="20"/>
<testCase name="Component Tests AuditsComponent Create sort object Should sort only by id asc" duration="16"/>
<testCase name="Component Tests AuditsComponent Create sort object Should sort by timestamp asc then by id" duration="19"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\password-reset\init\password-reset-init.component.spec.ts">
<testCase name="Component Tests PasswordResetInitComponent should define its initial state" duration="29"/>
<testCase name="Component Tests PasswordResetInitComponent sets focus after the view has been initialized" duration="22"/>
<testCase name="Component Tests PasswordResetInitComponent notifies of success upon successful requestReset" duration="16"/>
<testCase name="Component Tests PasswordResetInitComponent notifies of unknown email upon email address not registered/400" duration="17"/>
<testCase name="Component Tests PasswordResetInitComponent notifies of error upon error response" duration="27"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\user-management\user-management-update.component.spec.ts">
<testCase name="Component Tests User Management Update Component OnInit Should load authorities and language on init" duration="161"/>
<testCase name="Component Tests User Management Update Component save Should call update service on save for existing user" duration="28"/>
<testCase name="Component Tests User Management Update Component save Should call create service on save for new user" duration="21"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\password\password.component.spec.ts">
<testCase name="Component Tests PasswordComponent should show error if passwords do not match" duration="31"/>
<testCase name="Component Tests PasswordComponent should call Auth.changePassword when passwords match" duration="24"/>
<testCase name="Component Tests PasswordComponent should set success to OK upon success" duration="25"/>
<testCase name="Component Tests PasswordComponent should notify of error if change password fails" duration="17"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\activate\activate.component.spec.ts">
<testCase name="Component Tests ActivateComponent calls activate.get with the key from params" duration="31"/>
<testCase name="Component Tests ActivateComponent should set set success to OK upon successful activation" duration="22"/>
<testCase name="Component Tests ActivateComponent should set set error to ERROR upon activation failure" duration="21"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\settings\settings.component.spec.ts">
<testCase name="Component Tests SettingsComponent should send the current identity upon save" duration="36"/>
<testCase name="Component Tests SettingsComponent should notify of success upon successful save" duration="30"/>
<testCase name="Component Tests SettingsComponent should notify of error upon failed save" duration="18"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\user-management\user-management.component.spec.ts">
<testCase name="Component Tests User Management Component OnInit Should call load all on init" duration="44"/>
<testCase name="Component Tests User Management Component setActive Should update user and call load all" duration="25"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\user-management\user-management-detail.component.spec.ts">
<testCase name="Component Tests User Management Detail Component OnInit Should call load all on init" duration="32"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\core\user\user.service.spec.ts">
<testCase name="Service Tests User Service Service methods should call correct URL" duration="21"/>
<testCase name="Service Tests User Service Service methods should return User" duration="15"/>
<testCase name="Service Tests User Service Service methods should return Authorities" duration="16"/>
<testCase name="Service Tests User Service Service methods should propagate not found response" duration="11"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\user-management\user-management-delete-dialog.component.spec.ts">
<testCase name="Component Tests User Management Delete Component confirmDelete Should call delete service on confirmDelete" duration="32"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\account\password\password-strength-bar.component.spec.ts">
<testCase name="Component Tests PasswordStrengthBarComponent PasswordStrengthBarComponents should initialize with default values" duration="30"/>
<testCase name="Component Tests PasswordStrengthBarComponent PasswordStrengthBarComponents should increase strength upon password value change" duration="22"/>
<testCase name="Component Tests PasswordStrengthBarComponent PasswordStrengthBarComponents should change the color based on strength" duration="24"/>
</file>
<file path="C:\Jenkins\Workspace\workspace\Test\src\test\javascript\spec\app\admin\audits\audits.service.spec.ts">
<testCase name="Service Tests Audits Service Service methods should call correct URL" duration="27"/>
<testCase name="Service Tests Audits Service Service methods should return Audits" duration="15"/>
<testCase name="Service Tests Audits Service Service methods should propagate not found response" duration="11"/>
</file>
</testExecutions>
End of the execution :
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39.391 s
[INFO] Finished at: 2018-07-04T18:48:37+02:00
[INFO] ------------------------------------------------------------------------
[Pipeline] step
Enregistrement des résultats des tests
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: Aucun des rapports de test ne contient de résultat
Finished: FAILURE
Motivation for or Use Case
Reproduce the error
Fresh app from jHipster with Jenkinfiles generated by jHipster ci-cd.
Suggest a Fix
Not found yet…
JHipster Version(s)
Tested on 5.0.1 and 5.0.0.
JHipster configuration
Basic app with default config is enough…
Entity configuration(s) entityName.json files generated in the .jhipster directory
None
Browsers and Operating System
My Jenkins is on Windows… Maybe it can help 😃
- Checking this box is mandatory (this is just to show you read everything)
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (19 by maintainers)
Commits related to this issue
- Merge pull request #7957 from GuiF007/master Fix #7928 : Adding jest-junit back, and adjust filename reports — committed to jhipster/generator-jhipster by pascalgrimaud 6 years ago
I will, it will be a my first in the generator, but let’s try, doesn’t seem sooo complicated.
PR is done, I cherry-picked one of your commit @pascalgrimaud, upgraded the jest-junit version, changed filenames. I tested and should be OK 😃
I confirm it fixed the issue. One thing I would change is: