diff --git a/perf-dashboard/deployment-latency/cloudbuild.yaml b/perf-dashboard/deployment-latency/cloudbuild.yaml index 5d7cae4c..74a675f3 100644 --- a/perf-dashboard/deployment-latency/cloudbuild.yaml +++ b/perf-dashboard/deployment-latency/cloudbuild.yaml @@ -2,3 +2,4 @@ steps: - name: ${_TEST_RUNNER} env: - GCLOUD_TRACK=${_GCLOUD_TRACK} + - GOOGLE_PROJECT_ID=${_GOOGLE_PROJECT_ID} diff --git a/perf-dashboard/deployment-latency/tests/CollectDeploymentLatencyTest.php b/perf-dashboard/deployment-latency/tests/CollectDeploymentLatencyTest.php index ca6e3760..40ad724f 100644 --- a/perf-dashboard/deployment-latency/tests/CollectDeploymentLatencyTest.php +++ b/perf-dashboard/deployment-latency/tests/CollectDeploymentLatencyTest.php @@ -22,7 +22,6 @@ class CollectDeploymentLatencyTest extends \PHPUnit_Framework_TestCase { const DEPLOYMENT_MAX_RETRY = 5; - const PROJECT_ID = 'php-perf-dash'; const DATASET_ID = 'deployment_latency'; const TABLE_ID = 'flex_deployments'; @@ -76,7 +75,7 @@ public function testDeploymentLatency() . str_replace('.', '', $reportName) . ' --no-stop-previous-version --no-promote'; $configCmd = 'gcloud config set app/use_runtime_builders ' - . $type === 'xrt' ? 'false' : 'true'; + . ($type === 'xrt' ? 'false' : 'true'); self::execWithError($configCmd, 'runtime-builders-config'); $latency = 0.0; while ($failureCount < self::DEPLOYMENT_MAX_RETRY) { @@ -121,7 +120,7 @@ private static function createBigQueryClient() return new BigQueryClient( [ - 'projectId' => self::PROJECT_ID, + 'projectId' => getenv('GOOGLE_PROJECT_ID'), 'accessToken' => $token['access_token'] ] ); diff --git a/scripts/record_deployment_latency.sh b/scripts/record_deployment_latency.sh index 0ba113f4..40e958c6 100755 --- a/scripts/record_deployment_latency.sh +++ b/scripts/record_deployment_latency.sh @@ -43,4 +43,4 @@ fi gcloud -q container builds submit perf-dashboard/deployment-latency\ --timeout 7200 \ --config perf-dashboard/deployment-latency/cloudbuild.yaml \ - --substitutions _TEST_RUNNER="${TEST_RUNNER}",_GCLOUD_TRACK="${GCLOUD_TRACK}" + --substitutions _TEST_RUNNER="${TEST_RUNNER}",_GCLOUD_TRACK="${GCLOUD_TRACK}",_GOOGLE_PROJECT_ID=${GOOGLE_PROJECT_ID}