-
Notifications
You must be signed in to change notification settings - Fork 1k
appengine/php72/tasks: update create task and add task handler app #746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| @@ -0,0 +1,81 @@ | |||
| <?php | |||
| /** | |||
| * Copyright 2018 Google Inc. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For new files, copyright should say Google LLC. instead of Google Inc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
| @@ -0,0 +1 @@ | |||
| runtime: php72 No newline at end of file | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: add newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
| print $output; | ||
| } | ||
|
|
||
| // [END cloud_tasks_appengine_quickstart] No newline at end of file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
| @@ -0,0 +1,68 @@ | |||
| <?php | |||
| /** | |||
| * Copyright 2018 Google Inc. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack.
| 'project' => self::$projectId, | ||
| 'queue' => $queue, | ||
| 'location' => $location | ||
| $output = $this->runSnippet('create_task', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Who deletes the queue after the test? Won't it fail if you run the test 2nd time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was set up by Brent earlier, I assume it's in Kokoro or that he means to leave the queue up permanently (which is what we're doing in Go). In theory the queue can take 2 minutes to deploy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think it's a problem of either 1) resource leak if the test runner script assign unique queue name every time, or 2) test failure on the 2nd run because the creation fails.
Also I suggest that you check if this test is really executed on kokoro. It might be just skipped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will double-check this, I thought we had a fixed queue that just happened to be configured in the job.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The queue name is my-appengine-queue and is pre-created.
- The create_task test result is as follows:
running phpunit in appengine/php72/tasks/snippets
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
Runtime: PHP 7.2.10
Configuration: /tmpfs/src/github/php-docs-samples/appengine/php72/tasks/snippets/phpunit.xml.dist
Error: No code coverage driver is available
. 1 / 1 (100%)
Time: 573 ms, Memory: 8.00MB
OK (1 test, 1 assertion)
The app/handler tests were skipped:
running phpunit in appengine/php72/tasks/apps/handler
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.
Runtime: PHP 7.2.10
Configuration: /tmpfs/src/github/php-docs-samples/appengine/php72/tasks/apps/handler/phpunit.xml.dist
Error: No code coverage driver is available
SS 2 / 2 (100%)
Time: 26 ms, Memory: 4.00MB
There were 2 skipped tests:
1) DeployTest
To run this test, set RUN_DEPLOYMENT_TESTS env to true.
/tmpfs/src/github/php-docs-samples/appengine/php72/tasks/apps/handler/vendor/google/cloud-tools/src/TestUtils/AppEngineDeploymentTrait.php:93
2) DeployTest
To run this test, set RUN_DEPLOYMENT_TESTS env to true.
/tmpfs/src/github/php-docs-samples/appengine/php72/tasks/apps/handler/vendor/google/cloud-tools/src/TestUtils/AppEngineDeploymentTrait.php:93
OK, but incomplete, skipped, or risky tests!
Tests: 4, Assertions: 0, Skipped: 2.
Not sure what the practice is around using the RUN_DEPLOYMENT_TESTS environment variable. @tmatsuo do you have insight on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, the test only uses the pre-created queue and there's no resource leak. Thanks for confirming this.
The deployment tests are usually executed in nightly run, or in full system test.
| 'project' => self::$projectId, | ||
| 'queue' => $queue, | ||
| 'location' => $location | ||
| $output = $this->runSnippet('create_task', [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok, the test only uses the pre-created queue and there's no resource leak. Thanks for confirming this.
The deployment tests are usually executed in nightly run, or in full system test.
This PR updates the Cloud Tasks create task sample to Beta v2.3 and moves it inside AppEngine in alignment with other Cloud Tasks for App Engine Queue samples.
Additional, there is a "task handler" app which demonstrates how to handle a Cloud Tasks http request for work to be done.
The snippet is following new structural trends demonstrated in Bigquery.