I have a drone setup, and my pipeline runs the following:
pipeline:
test:
image: node:8.3.0
commands:
- npm install --only=dev
- npm run automation
The automation script in my package.json is as follow:
"automation": "node automation/automation.js"
So it runs a Javascript file, this file creates a selenium
driver and launches it to a page etc.
If I run the script manually, it will run my selenium
tests and finish once all the of it is ended, as expected.
But when drone
runs it, it exits the pipeline step as soon as the entire javascript has been executed, even though there are still asynchronous tasks (from the selenium
driver) running. This makes my tests end early and unable to report results properly.
What am I doing wrong?