Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
- name: Run behat tests
command: 'cd /var/www/html/tests ; composer install ; ./bin/behat --profile probo --tags "~@javascript"'
- name: Run behat js tests
command: 'wget ; apt-get install xvfb -y ; xvfb-run java -jar selenium-server-standalone-2.48.2.jar & ; ./bin/behat --profile probo --tags "@javascript" ; disown'
Copy link

Instead of

cd /var/www/html/tests ; composer install ; ./bin/behat --profile probo --tags "~@javascript"

(separating the subcommands with semicolons) I would use

cd /var/www/html/tests && composer install && ./bin/behat --profile probo --tags "~@javascript"

The difference is that if one of the subcommands fails (returns a non-zero exit code) then the later subcommands will not be executed if you separate them with &&.

I would also use && instead of ; for the second command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment