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

Prevent failing test from failing the task/build (CI) #1178

Closed
zakrhol opened this issue Aug 8, 2014 · 3 comments
Closed

Prevent failing test from failing the task/build (CI) #1178

zakrhol opened this issue Aug 8, 2014 · 3 comments

Comments

@zakrhol
Copy link

zakrhol commented Aug 8, 2014

I have recently set up protractor for e2e tesing our angular applications.
The projects are build and tested with gradle script.
I'm using gradle-node-plugin to run protractor test after the project is built.

The problem is that a failing protractor test causes the build-job to fail (becomes red on jenkins) - this is not the desired behaviour. Failing tests should make the job yellow and ERRORS like 'Selenium server cannot be started' must make the job red.

I was looking for a configuration flag like
failTaskOnTestFailure = false but didnt find anything.

gradle-node-plugin has an option ignoreExitValue = true but this does not help as it will also ignore other Errors like syntax errors in the spec and the job becomes green as no tests runs and fails.

Is there a way to make protractor behave that way?

A working alternative I tried is letting the onCleanUp : function(exitCode) { return a new status code, this way I can change 1 back to 0.

@hankduan
Copy link
Contributor

hankduan commented Aug 8, 2014

The line you're interested in is
var exitCode = passed ? 0 : 1;
in lib/runner.js.

You can feel free to change that line to output whatever exit code you want. However, I feel that it is the correct behavior for exit code to be non zero on test failure.

@zakrhol
Copy link
Author

zakrhol commented Aug 11, 2014

However, I feel that it is the correct behavior for exit code to be non zero on test failure.

Agreed, but which code can I use which does not fail the gradle-task? I have added a question at gradle-node-plugin

@juliemr
Copy link
Member

juliemr commented Aug 18, 2014

This is a question for gradle - closing as answered here.

@juliemr juliemr closed this as completed Aug 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants