Skip to content
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

bug / maven frontend plugin 1.6 #1464

Merged
merged 4 commits into from
Oct 6, 2017
Merged

Conversation

cliffmeyers
Copy link
Contributor

Description

  • Use maven-frontend-plugin:1.6 so that maven.test.failure.ignore is respected correctly.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verified the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

@cliffmeyers
Copy link
Contributor Author

In 1.4 this behavior was broken. I posted a comparison of 1.4 and 1.6 here: eirslett/frontend-maven-plugin#534 (comment) but will include it here too for convenience.

Copy link
Collaborator

@kzantow kzantow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay for dashes...

@cliffmeyers
Copy link
Contributor Author

The behavior does appear broken in 1.4 (failures during the test phase are always ignored). In 1.6 it works as expected. In these examples, I've introduced a failing test case that is run via gulp + gulp-jest.

Run a gulp build that finishes with exit code 1:

macbook-15:blueocean-dashboard cmeyers$ mvn clean install
...
[ERROR] Test Suites: 1 failed, 2 skipped, 26 passed, 27 of 29 total
[ERROR] Tests:       1 failed, 8 skipped, 149 passed, 158 total
[ERROR] Snapshots:   0 total
[ERROR] Time:        26.889s
[ERROR] Ran all test suites.
[INFO] [10:52:58] tests failed or errored!
[ERROR] 
[ERROR] npm ERR! Darwin 15.6.0
[ERROR] npm ERR! argv "/Users/cmeyers/Development/code/blueocean/blueocean-dashboard/node/node" "/Users/cmeyers/Development/code/blueocean/blueocean-dashboard/node/node_modules/npm/bin/npm-cli.js" "run" "mvntest"
[ERROR] npm ERR! node v6.4.0
[ERROR] npm ERR! npm  v3.10.3
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! blueocean-dashboard@0.0.1 mvntest: `gulp test`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the blueocean-dashboard@0.0.1 mvntest script 'gulp test'.
[ERROR] npm ERR! Make sure you have the latest version of node.js and npm installed.
[ERROR] npm ERR! If you do, this is most likely a problem with the blueocean-dashboard package,
[ERROR] npm ERR! not with npm itself.
[ERROR] npm ERR! Tell the author that this fails on your system:
[ERROR] npm ERR!     gulp test
[ERROR] npm ERR! You can get information on how to open an issue for this project with:
[ERROR] npm ERR!     npm bugs blueocean-dashboard
[ERROR] npm ERR! Or if that isn't available, you can get their info via:
[ERROR] npm ERR!     npm owner ls blueocean-dashboard
[ERROR] npm ERR! There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! Please include the following file with any support request:
[ERROR] npm ERR!     /Users/cmeyers/Development/code/blueocean/blueocean-dashboard/npm-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

Run again with the maven.test.failure.ignore property set:

mvn clean test -Dmaven.test.failure.ignore
...
[ERROR] Test Suites: 1 failed, 2 skipped, 26 passed, 27 of 29 total
[ERROR] Tests:       1 failed, 8 skipped, 149 passed, 158 total
[ERROR] Snapshots:   0 total
[ERROR] Time:        25.227s
[ERROR] Ran all test suites.
[INFO] [10:56:22] tests failed or errored!
[ERROR] 
[ERROR] npm ERR! Darwin 15.6.0
[ERROR] npm ERR! argv "/Users/cmeyers/Development/code/blueocean/blueocean-dashboard/node/node" "/Users/cmeyers/Development/code/blueocean/blueocean-dashboard/node/node_modules/npm/bin/npm-cli.js" "run" "mvntest"
[ERROR] npm ERR! node v6.4.0
[ERROR] npm ERR! npm  v3.10.3
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! blueocean-dashboard@0.0.1 mvntest: `gulp test`
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR! 
[ERROR] npm ERR! Failed at the blueocean-dashboard@0.0.1 mvntest script 'gulp test'.
[ERROR] npm ERR! Make sure you have the latest version of node.js and npm installed.
[ERROR] npm ERR! If you do, this is most likely a problem with the blueocean-dashboard package,
[ERROR] npm ERR! not with npm itself.
[ERROR] npm ERR! Tell the author that this fails on your system:
[ERROR] npm ERR!     gulp test
[ERROR] npm ERR! You can get information on how to open an issue for this project with:
[ERROR] npm ERR!     npm bugs blueocean-dashboard
[ERROR] npm ERR! Or if that isn't available, you can get their info via:
[ERROR] npm ERR!     npm owner ls blueocean-dashboard
[ERROR] npm ERR! There is likely additional logging output above.
[ERROR] 
[ERROR] npm ERR! Please include the following file with any support request:
[ERROR] npm ERR!     /Users/cmeyers/Development/code/blueocean/blueocean-dashboard/npm-debug.log
[ERROR] There are test failures.
Failed to run task: 'npm run mvntest' failed.
com.github.eirslett.maven.plugins.frontend.lib.TaskRunnerException: 'npm run mvntest' failed.
	at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute(NodeTaskExecutor.java:63)
	at com.github.eirslett.maven.plugins.frontend.mojo.NpmMojo.execute(NpmMojo.java:62)
	at com.github.eirslett.maven.plugins.frontend.mojo.AbstractFrontendMojo.execute(AbstractFrontendMojo.java:94)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutionException: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.execute(ProcessExecutor.java:82)
	at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.executeAndRedirectOutput(ProcessExecutor.java:64)
	at com.github.eirslett.maven.plugins.frontend.lib.NodeExecutor.executeAndRedirectOutput(NodeExecutor.java:29)
	at com.github.eirslett.maven.plugins.frontend.lib.NodeTaskExecutor.execute(NodeTaskExecutor.java:58)
	... 24 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
	at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:404)
	at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:166)
	at com.github.eirslett.maven.plugins.frontend.lib.ProcessExecutor.execute(ProcessExecutor.java:74)
	... 27 more
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

They also added this useful logging statement to non-test phases:

[INFO] --- frontend-maven-plugin:1.6:npm (npm install) @ blueocean-dashboard ---
[INFO] testFailureIgnore property is ignored in non test phases
[INFO] Running 'npm install' in /Users/cmeyers/Development/code/blueocean/blueocean-dashboard

@cliffmeyers
Copy link
Contributor Author

Build with a failing JS test that doesn't include -Dmaven.test.failure.ignore in Jenkinsfile which fails as expected: https://ci.blueocean.io/blue/organizations/jenkins/blueocean/detail/bug%2Ffrontend-plugin-1.6/2/pipeline

@cliffmeyers
Copy link
Contributor Author

Build with a failing JS test that includes the standard -Dmaven.test.failure.ignore in Jenkinsfile like we've had now for a long time: https://ci.blueocean.io/blue/organizations/jenkins/blueocean/detail/bug%2Ffrontend-plugin-1.6/3/tests

@cliffmeyers
Copy link
Contributor Author

Removed the failing test is last commit, all is well: https://ci.blueocean.io/blue/organizations/jenkins/blueocean/detail/bug%2Ffrontend-plugin-1.6/4/tests

@cliffmeyers
Copy link
Contributor Author

@michaelneale will wait for you to give the final thumbs up here. I think this is the way to go though.

@michaelneale
Copy link
Member

You are go for landing. Nice one 🐝

@cliffmeyers cliffmeyers merged commit 877c395 into master Oct 6, 2017
@cliffmeyers cliffmeyers deleted the bug/frontend-plugin-1.6 branch October 6, 2017 17:43
cliffmeyers added a commit that referenced this pull request Oct 6, 2017
* use maven-frontend-plugin:1.6 so that maven.test.failure.ignore property is respected correctly

* introduce a test failure and remove the maven.test.failure.ignore property to show the build failing

* add maven.test.failure.ignore property back to show the build as unstable

* remove the intentionally failing test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants