-
Notifications
You must be signed in to change notification settings - Fork 439
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
feat(tests): organize workflows, add system tests #7695
Conversation
@@ -212,6 +213,9 @@ public static function generatedSystemTestBootstrap() | |||
// For generated system tests, we need to set GOOGLE_APPLICATION_CREDENTIALS | |||
// and PROJECT_ID to appropriate values | |||
$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH'); | |||
if (empty($keyFilePath)) { | |||
exit('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH must be set to run system tests.'); |
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.
Nit:
Should we place this as a constant somewhere? I see that this env
is used in several places. I think if this code needs maintenance it would be easier to have all of the places using one constant and easy to change in one place rather than using a string.
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.
Yes absolutely. I've added your suggestion (and some of my own) in this issue so that we can clean this part up soon
$keyFilePath = getenv('GOOGLE_CLOUD_PHP_TESTS_KEY_PATH'); | ||
$keyFileData = json_decode(file_get_contents($keyFilePath), true); | ||
$projectId = $keyFileData['project_id']; |
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.
json_decode
can return false
, should we check for it?
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.
Good call, done!
The new
system-tests.yaml
workflow has passed, but it's being skipped in this PR.