From bf4a4270e1dcbb3cbcca1eb6da706ce45d6c788a Mon Sep 17 00:00:00 2001 From: The Magician Date: Thu, 17 Dec 2020 10:26:23 -0800 Subject: [PATCH] Fix composer tests (#4323) (#2795) Signed-off-by: Modular Magician --- .changelog/4323.txt | 3 +++ google-beta/data_source_google_composer_environment.go | 10 +++++++++- .../data_source_google_composer_environment_test.go | 5 ++--- google-beta/resource_composer_environment_test.go | 2 +- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 .changelog/4323.txt diff --git a/.changelog/4323.txt b/.changelog/4323.txt new file mode 100644 index 0000000000..8ec013c069 --- /dev/null +++ b/.changelog/4323.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google-beta/data_source_google_composer_environment.go b/google-beta/data_source_google_composer_environment.go index 6713545b03..9c39c0c04b 100644 --- a/google-beta/data_source_google_composer_environment.go +++ b/google-beta/data_source_google_composer_environment.go @@ -7,9 +7,17 @@ import ( ) func dataSourceGoogleComposerEnvironment() *schema.Resource { + dsSchema := datasourceSchemaFromResourceSchema(resourceComposerEnvironment().Schema) + + // Set 'Required' schema elements + addRequiredFieldsToSchema(dsSchema, "name") + + // Set 'Optional' schema elements + addOptionalFieldsToSchema(dsSchema, "project", "region") + return &schema.Resource{ Read: dataSourceGoogleComposerEnvironmentRead, - Schema: resourceComposerEnvironment().Schema, + Schema: dsSchema, } } diff --git a/google-beta/data_source_google_composer_environment_test.go b/google-beta/data_source_google_composer_environment_test.go index 9fe045bd6c..5291d590f2 100644 --- a/google-beta/data_source_google_composer_environment_test.go +++ b/google-beta/data_source_google_composer_environment_test.go @@ -104,9 +104,8 @@ resource "google_compute_subnetwork" "test" { } data "google_composer_environment" "test" { - name = google_composer_environment.test.name - - depends_on = [google_composer_environment.test] + name = google_composer_environment.test.name + region = google_composer_environment.test.region } `, context) } diff --git a/google-beta/resource_composer_environment_test.go b/google-beta/resource_composer_environment_test.go index 9750ee8783..9279d1462b 100644 --- a/google-beta/resource_composer_environment_test.go +++ b/google-beta/resource_composer_environment_test.go @@ -881,7 +881,7 @@ resource "google_composer_environment" "test" { } software_config { pypi_packages = { - scipy = "==1.1.0" + numpy = "" } } }