run_tests.sh 617 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #!/bin/bash
  2. #exit on errors
  3. set -e
  4. #run server
  5. echo "Starting server..."
  6. node httpwsd.js &
  7. serverpid=$!
  8. sleep 3
  9. #check if server is dead
  10. if ! kill -0 "$serverpid"; then
  11. wait $serverpid
  12. server_status=$?
  13. exit $server_status
  14. fi
  15. #run mt script
  16. echo "Starting model transformation script..."
  17. python2 mt/main.py &
  18. mtpid=$!
  19. sleep 3
  20. #check if model transformer is dead
  21. if ! kill -0 "$mtpid"; then
  22. wait $mtpid
  23. mt_status=$?
  24. exit $mt_status
  25. fi
  26. echo "Starting tests..."
  27. #start nightwatch tests
  28. nightwatch
  29. echo "Stopping server and mt script..."
  30. kill "$serverpid"
  31. kill "$mtpid"
  32. echo "Finished!"