jorundur
jorundur

Reputation: 670

Build won't fail in Travis-CI, even though Selenium test fails

I'm building a project where we have to run end-to-end tests with Selenium like so: Run focused integration or End-to-end tests (e.g. Selenium). It is necessary to run this on an external staging server (e.g. Heroku). To run the integration test the application needs to connect to an external system e.g. database.

This very likely has something to do with our .travis.yml file, which looks something like this now (even though we have gone very back-and-forth with the file):

...
script: 
- ./gradlew check
deploy:
provider: heroku
api_key:
secure: *****
app: *****
after_deploy: 
- ./gradlew seleniumXvfb

Basically, what we want to do is first run ./gradlew check which runs unit tests, then deploy the application to heroku and finally run Selenium tests (end-to-end tests) on the staging server (heroku).

But, what happens is that travis doesn't seem to care that the selenium tests fails when it should fail. Travis shows the green checkmark for the build in whole, like everything is OK.

When this is all over, we want to deploy to a production server.

Thank you.

Upvotes: 0

Views: 368

Answers (1)

roidrage
roidrage

Reputation: 2341

after_deploy currently doesn't fail the build in Travis CI.

If you want to test your application against a running staging system on Heroku, then I'd recommend deploying this manually as part of the before_script step and then running the ./gradlew seleniumXvfb command in your script section.

That way you can then do a proper production deployment based on the success of testing against your staging system.

Upvotes: 2

Related Questions