0

To run PHPUnit tests on Google Cloud's App Engine, I understand I would need to run a command on the command line like for example phpunit --bootstrap src/autoload.php tests/MoneyTest.

I tried opening the Google Cloud Shell in the Cloud Console, but I cannot seem to locate the code that I uploaded to be able to execute that command. When I use find -name "index.php" it shows me directories like ./etc/docker and ./run/dockerand a bunch of other locations, but all return a Permission denied message.

On the other hand, I tried creating a special webpage test.php that would just run the tests that I wanted to do, but I get a timeout error since the tests take way to long to run and it gets cut off after some seconds.

How could I use PHPUnit tests on the AppEngine, and not only locally on my machine?

Roel Vermeulen
  • 594
  • 7
  • 15

1 Answers1

1

App Engine is not the best tool to solve this problem because App Engine is designed to handle short-lived HTTP requests, not running long processes. Yes, there are ways run jobs of up to 10 minutes, but at some point you'll hit that timeout too.

Google Cloud Platform offers better solutions for long running processes. The most straight-forward is Google Compute Engine where you can run a dedicated Linux instance.

Jeffrey Rennie
  • 3,193
  • 1
  • 18
  • 19