From 6435f1ff9af3a6365812364c45f944dbff9d24d8 Mon Sep 17 00:00:00 2001 From: Imran Nayer Date: Wed, 23 Apr 2025 17:43:23 +0000 Subject: [PATCH 1/2] fix: update nodejs version in bq-log-alerting --- modules/bq-log-alerting/main.tf | 2 +- test/integration/bq-log-alerting/controls/gcp.rb | 2 +- test/integration/logbucket-project/logbucket_project_test.go | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/bq-log-alerting/main.tf b/modules/bq-log-alerting/main.tf index fb7ba097..84465cdf 100644 --- a/modules/bq-log-alerting/main.tf +++ b/modules/bq-log-alerting/main.tf @@ -92,7 +92,7 @@ module "bq-log-alerting" { function_entry_point = "cronPubSub" function_source_directory = "${path.module}/logging/cloud_function" function_name = "generate-alerts" - function_runtime = "nodejs14" + function_runtime = "nodejs20" function_service_account_email = google_service_account.gcf_service_account.email function_timeout_s = var.function_timeout function_available_memory_mb = var.function_memory diff --git a/test/integration/bq-log-alerting/controls/gcp.rb b/test/integration/bq-log-alerting/controls/gcp.rb index 72eb57eb..81175e49 100644 --- a/test/integration/bq-log-alerting/controls/gcp.rb +++ b/test/integration/bq-log-alerting/controls/gcp.rb @@ -72,7 +72,7 @@ its('description') { should eq 'read from BQ view to generate alerts' } its('timeout') { should eq '540s' } its('available_memory_mb') { should eq 256 } - its('runtime') { should eq 'nodejs14' } + its('runtime') { should eq 'nodejs20' } its('environment_variables') { should include( 'CSCC_SOURCE' => source_name, diff --git a/test/integration/logbucket-project/logbucket_project_test.go b/test/integration/logbucket-project/logbucket_project_test.go index 76bfe3d8..fce28e75 100644 --- a/test/integration/logbucket-project/logbucket_project_test.go +++ b/test/integration/logbucket-project/logbucket_project_test.go @@ -85,8 +85,8 @@ func TestLogBucketProjectModule(t *testing.T) { assert.Equal(tc.writerIdentity, logSinkDetails.Get("writerIdentity").String(), "log sink writerIdentity should match") // assert linked dataset name & BigQuery Dataset ID - projectNumber := gcloud.Runf(t, "projects describe %s", tc.projId).Get("projectNumber").String() - bigqueryDatasetID := fmt.Sprintf("bigquery.googleapis.com/projects/%s/datasets/%s", projectNumber, tc.linkedDsID) + // projectNumber := gcloud.Runf(t, "projects describe %s", tc.projId).Get("projectNumber").String() + bigqueryDatasetID := fmt.Sprintf("bigquery.googleapis.com/projects/%s/datasets/%s", tc.projId, tc.linkedDsID) linkedDs := gcloud.Runf(t, "logging links describe %s --bucket=%s --location=%s --project=%s", tc.linkedDsID, tc.bktName, "global", tc.projId) assert.Equal(tc.linkedDsName, linkedDs.Get("name").String(), "log bucket linked dataset name should match") assert.Equal(bigqueryDatasetID, linkedDs.Get("bigqueryDataset.datasetId").String(), "log bucket BigQuery dataset ID should match") From e1221642134f5d6431563b2ebe5147af727892dd Mon Sep 17 00:00:00 2001 From: Imran Nayer Date: Thu, 24 Apr 2025 17:06:09 +0000 Subject: [PATCH 2/2] removed commented code --- test/integration/logbucket-project/logbucket_project_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/test/integration/logbucket-project/logbucket_project_test.go b/test/integration/logbucket-project/logbucket_project_test.go index fce28e75..903a1292 100644 --- a/test/integration/logbucket-project/logbucket_project_test.go +++ b/test/integration/logbucket-project/logbucket_project_test.go @@ -85,7 +85,6 @@ func TestLogBucketProjectModule(t *testing.T) { assert.Equal(tc.writerIdentity, logSinkDetails.Get("writerIdentity").String(), "log sink writerIdentity should match") // assert linked dataset name & BigQuery Dataset ID - // projectNumber := gcloud.Runf(t, "projects describe %s", tc.projId).Get("projectNumber").String() bigqueryDatasetID := fmt.Sprintf("bigquery.googleapis.com/projects/%s/datasets/%s", tc.projId, tc.linkedDsID) linkedDs := gcloud.Runf(t, "logging links describe %s --bucket=%s --location=%s --project=%s", tc.linkedDsID, tc.bktName, "global", tc.projId) assert.Equal(tc.linkedDsName, linkedDs.Get("name").String(), "log bucket linked dataset name should match")