1

Trying to run some automated tests in TravisCI pipeline. To run these tests, I need to keep my local server running on Travis. And then run the automated test on that local server.

My automated tests are present in directory - sanity-tests.

Note- - cd $TRAVIS_BUILD_DIR/sanity-tests - yarn test these commands should only get triggered once the server is started and keep running. After tests are done we can close the server.

.yaml file

language: node_js
node_js: lts/*
services: xvfb
cache:
  yarn: true
sudo: true
install: yarn

script:
  - yarn install
  - yarn start
  - cd $TRAVIS_BUILD_DIR/sanity-tests
  - yarn test

In the above script - in the first 2 steps,- yarn install - yarn start - I'm installing dependencies and running my local server. but because "yarn start" commands runs the local server and does not get exited, I'm not able to run the next commands which are - cd $TRAVIS_BUILD_DIR/sanity-tests - yarn test

Vishu
  • 1,105
  • 3
  • 10
  • 19

0 Answers0