diff --git a/tests/integration/gcp_bigquery_dataset/tasks/main.yml b/tests/integration/gcp_bigquery_dataset/tasks/main.yml index b8a3f23..609caf1 100644 --- a/tests/integration/gcp_bigquery_dataset/tasks/main.yml +++ b/tests/integration/gcp_bigquery_dataset/tasks/main.yml @@ -49,7 +49,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*my_example_dataset.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a dataset that already exists gcp_bigquery_dataset: @@ -93,7 +93,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*my_example_dataset.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a dataset that does not exist gcp_bigquery_dataset: diff --git a/tests/integration/gcp_bigquery_table/tasks/main.yml b/tests/integration/gcp_bigquery_table/tasks/main.yml index 86c8282..a06a71b 100644 --- a/tests/integration/gcp_bigquery_table/tasks/main.yml +++ b/tests/integration/gcp_bigquery_table/tasks/main.yml @@ -66,7 +66,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*example_table.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a table that already exists gcp_bigquery_table: @@ -117,7 +117,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*example_table.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a table that does not exist gcp_bigquery_table: diff --git a/tests/integration/gcp_cloudscheduler_job/tasks/main.yml b/tests/integration/gcp_cloudscheduler_job/tasks/main.yml index 4829086..b48ccd6 100644 --- a/tests/integration/gcp_cloudscheduler_job/tasks/main.yml +++ b/tests/integration/gcp_cloudscheduler_job/tasks/main.yml @@ -67,7 +67,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*job.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a job that already exists gcp_cloudscheduler_job: @@ -128,7 +128,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*job.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a job that does not exist gcp_cloudscheduler_job: diff --git a/tests/integration/gcp_iam_role/tasks/main.yml b/tests/integration/gcp_iam_role/tasks/main.yml index a8f6da8..8745bd2 100644 --- a/tests/integration/gcp_iam_role/tasks/main.yml +++ b/tests/integration/gcp_iam_role/tasks/main.yml @@ -56,7 +56,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*myCustomRole2.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a role that already exists gcp_iam_role: @@ -106,7 +106,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*myCustomRole2.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a role that does not exist gcp_iam_role: diff --git a/tests/integration/gcp_iam_service_account/tasks/main.yml b/tests/integration/gcp_iam_service_account/tasks/main.yml index 52f4af9..aa6dab3 100644 --- a/tests/integration/gcp_iam_service_account/tasks/main.yml +++ b/tests/integration/gcp_iam_service_account/tasks/main.yml @@ -46,7 +46,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{ sa_name }}.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a service account that already exists gcp_iam_service_account: @@ -86,7 +86,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{ sa_name }}.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a service account that does not exist gcp_iam_service_account: diff --git a/tests/integration/gcp_redis_instance/tasks/main.yml b/tests/integration/gcp_redis_instance/tasks/main.yml index 5fd5418..a0856f6 100644 --- a/tests/integration/gcp_redis_instance/tasks/main.yml +++ b/tests/integration/gcp_redis_instance/tasks/main.yml @@ -73,7 +73,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*instance37.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_redis_instance: @@ -132,7 +132,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*instance37.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_redis_instance: diff --git a/tests/integration/gcp_resourcemanager_project/tasks/main.yml b/tests/integration/gcp_resourcemanager_project/tasks/main.yml index d98ab5e..b594d69 100644 --- a/tests/integration/gcp_resourcemanager_project/tasks/main.yml +++ b/tests/integration/gcp_resourcemanager_project/tasks/main.yml @@ -50,7 +50,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*My Sample Project.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a project that already exists gcp_resourcemanager_project: @@ -94,7 +94,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*My Sample Project.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a project that does not exist gcp_resourcemanager_project: diff --git a/tests/integration/gcp_sourcerepo_repository/tasks/main.yml b/tests/integration/gcp_sourcerepo_repository/tasks/main.yml index fe47467..bfa9540 100644 --- a/tests/integration/gcp_sourcerepo_repository/tasks/main.yml +++ b/tests/integration/gcp_sourcerepo_repository/tasks/main.yml @@ -44,7 +44,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a repository that already exists gcp_sourcerepo_repository: @@ -82,7 +82,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a repository that does not exist gcp_sourcerepo_repository: diff --git a/tests/integration/gcp_sql_instance/tasks/main.yml b/tests/integration/gcp_sql_instance/tasks/main.yml index af75218..0bee3e3 100644 --- a/tests/integration/gcp_sql_instance/tasks/main.yml +++ b/tests/integration/gcp_sql_instance/tasks/main.yml @@ -59,7 +59,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{resource_name}}-2.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a instance that already exists gcp_sql_instance: @@ -113,7 +113,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{resource_name}}-2.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a instance that does not exist gcp_sql_instance: diff --git a/tests/integration/gcp_tpu_node/tasks/main.yml b/tests/integration/gcp_tpu_node/tasks/main.yml index 10c10ee..06157f9 100644 --- a/tests/integration/gcp_tpu_node/tasks/main.yml +++ b/tests/integration/gcp_tpu_node/tasks/main.yml @@ -53,7 +53,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length >= 1 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 1 # ---------------------------------------------------------------------------- - name: create a node that already exists gcp_tpu_node: @@ -100,7 +100,7 @@ - name: verify that command succeeded assert: that: - - results['resources'] | length == 0 + - results['resources'] | map(attribute='name') | select("match", ".*{{ resource_name }}.*") | list | length == 0 # ---------------------------------------------------------------------------- - name: delete a node that does not exist gcp_tpu_node: