run-api-tests.sh 559 B

12345678910111213141516171819
  1. #!/usr/bin/env sh
  2. export APP_ENV=test
  3. export DB_DRIVER=postgres
  4. export TEST_ENV=api
  5. # Try to stop server just in case it hanged in last execution
  6. vendor/bin/laminas mezzio:swoole:stop
  7. echo 'Starting server...'
  8. vendor/bin/laminas mezzio:swoole:start -d
  9. sleep 2
  10. vendor/bin/phpunit --order-by=random -c phpunit-api.xml --testdox --colors=always --log-junit=build/coverage-api/junit.xml $*
  11. testsExitCode=$?
  12. vendor/bin/laminas mezzio:swoole:stop
  13. # Exit this script with the same code as the tests. If tests failed, this script has to fail
  14. exit $testsExitCode