mirror of
https://github.com/ansible-collections/google.cloud.git
synced 2025-04-03 17:30:27 -07:00
Enabling working integration tests (#504)
Enabling tests that work without any further modification as an incremental step to enabling all integration tests. Enabling 22 / 64 tests. The following tests do not work today: - gcp_appengine_firewall_rule - gcp_bigtable_instance - gcp_cloudfunctions_cloud_function - gcp_cloudtasks_queue - gcp_compute_backend_service - gcp_compute_external_vpn_gateway - gcp_compute_forwarding_rule - gcp_compute_instance - gcp_compute_instance_group - gcp_compute_instance_group_manager - gcp_compute_instance_group_template - gcp_compute_node_group - gcp_compute_region_autoscaler - gcp_compute_region_instance_group_manager - gcp_compute_region_target_http_proxy - gcp_compute_region_target_https_proxy - gcp_compute_region_url_map - gcp_compute_route - gcp_compute_router - gcp_compute_ssl_certificate - gcp_compute_target_http_proxy - gcp_compute_target_https_proxy - gcp_compute_target_instance - gcp_compute_target_pool - gcp_compute_target_ssl_proxy - gcp_compute_target_tcp_proxy - gcp_compute_target_vpn_proxy - gcp_container_cluster - gcp_container_node_pool - gcp_iam_role - gcp_iam_service_account - gcp_iam_service_account_key - gcp_kms_key_ring - gcp_mlengine_version - gcp_redis_instance - gcp_resourcemanager_project - gcp_serviceusage_service - gcp_spanner_database - gcp_spanner_instance - gcp_sql_ssl_cert - gcp_storage_bucket - gcp_tpu_node
This commit is contained in:
parent
76677279f0
commit
c5723b214f
50 changed files with 121 additions and 87 deletions
.github/workflows
CONTRIBUTING.mdrequirements.txtscripts
tests/integration/targets
gcp_bigquery_dataset
gcp_bigquery_table
gcp_bigtable_instance
gcp_cloudbuild_trigger
gcp_cloudscheduler_job
gcp_compute_address
gcp_compute_backend_bucket
gcp_compute_backend_service
gcp_compute_external_vpn_gateway
gcp_compute_firewall
gcp_compute_global_address
gcp_compute_global_forwarding_rule
gcp_compute_health_check
gcp_compute_http_health_check
gcp_compute_https_health_check
gcp_compute_image
gcp_compute_interconnect_attachment
gcp_compute_managed_ssl_certificate
gcp_compute_network
gcp_compute_network_endpoint_group
gcp_compute_node_template
gcp_compute_region_backend_service
gcp_compute_region_health_check
gcp_compute_reservation
gcp_compute_resource_policy
gcp_compute_snapshot
gcp_compute_ssl_policy
gcp_compute_subnetwork
gcp_compute_url_map
gcp_dns_managed_zone
gcp_dns_resource_record_set
gcp_filestore_instance
gcp_iam_service_account_key
gcp_logging_metric
gcp_mlengine_model
gcp_pubsub_subscription
gcp_pubsub_topic
gcp_runtimeconfig_config
gcp_runtimeconfig_variable
gcp_sourcerepo_repository
gcp_sql_database
gcp_sql_instance
gcp_sql_user
gcp_storage_bucket_access_control
gcp_storage_default_object_acl
gcp_storage_object
|
@ -45,4 +45,5 @@ jobs:
|
|||
env: ${{ secrets }}
|
||||
run: echo "$CI_SERVICE_ACCOUNT_FILE_CONTENTS"
|
||||
- name: Run integration tests
|
||||
run: ansible-test integration -vvv --color --python 3.8 --venv-system-site-packages
|
||||
# Add the -vvv flag to print out more output
|
||||
run: ansible-test integration -v --color --python 3.8 --venv-system-site-packages
|
|
@ -40,6 +40,20 @@ gcp_cred_kind: @CRED_KIND
|
|||
gcp_cred_email: @EMAIL
|
||||
```
|
||||
|
||||
#### Setting up the project for testing
|
||||
|
||||
Some of the setup of the project itself is done outside of the test,
|
||||
and is expected to be configured beforehand.
|
||||
|
||||
For convenience, a bootstrap script is provided.
|
||||
|
||||
NOTE: running this script will make irreversible changes in your
|
||||
GCP project (e.g. create an AppEngine project):
|
||||
|
||||
```bash
|
||||
bash ./scripts/bootstrap-project.sh $PROJECT_ID $SERVICE_ACCOUNT_NAME
|
||||
```
|
||||
|
||||
### Running
|
||||
|
||||
Run `ansible-test integration`. Currently some tests are disabled as [test are being verified and added](https://github.com/ansible-collections/google.cloud/issues/499).
|
|
@ -1,2 +1,3 @@
|
|||
requests
|
||||
google-auth
|
||||
google-cloud-storage
|
||||
|
|
60
scripts/bootstrap-project.sh
Executable file
60
scripts/bootstrap-project.sh
Executable file
|
@ -0,0 +1,60 @@
|
|||
#!/usr/bin/env bash
|
||||
# Bootstrap-project sets a project up so that ansible-test integration
|
||||
# can be run.
|
||||
#
|
||||
# dependencies:
|
||||
# - google-cloud-sdk (gcloud)
|
||||
#
|
||||
#
|
||||
PROJECT_ID="${1}"
|
||||
SERVICE_ACCOUNT_NAME="${2}"
|
||||
SERVICE_LIST=(
|
||||
"appengine"
|
||||
"bigtable"
|
||||
"cloudfunctions"
|
||||
"cloudkms.googleapis.com"
|
||||
"cloudresourcemanager.googleapis.com"
|
||||
"cloudscheduler.googleapis.com"
|
||||
"cloudtasks.googleapis.com"
|
||||
"container"
|
||||
"dns"
|
||||
"file.googleapis.com"
|
||||
"ml.googleapis.com"
|
||||
"runtimeconfig.googleapis.com"
|
||||
"sourcerepo.googleapis.com"
|
||||
"spanner.googleapis.com"
|
||||
"sqladmin.googleapis.com"
|
||||
"storage.googleapis.com"
|
||||
"tpu.googleapis.com"
|
||||
)
|
||||
|
||||
REQUIRED_ROLE_LIST=(
|
||||
"roles/storage.objectAdmin"
|
||||
"roles/source.admin"
|
||||
)
|
||||
|
||||
for SERVICE in "${SERVICE_LIST[@]}"; do
|
||||
echo "enabling service $SERVICE..."
|
||||
gcloud services enable "$SERVICE" --project="$PROJECT_ID"
|
||||
done
|
||||
|
||||
for ROLE in "${REQUIRED_ROLE_LIST[@]}"; do
|
||||
echo "enabling role $ROLE..."
|
||||
gcloud projects add-iam-policy-binding "$PROJECT_ID" \
|
||||
--member="serviceAccount:$SERVICE_ACCOUNT_NAME" \
|
||||
--role="$ROLE"
|
||||
done
|
||||
|
||||
if ! gcloud app describe --project="$PROJECT_ID" > /dev/null; then
|
||||
echo "creating appengine project..."
|
||||
gcloud app create --project="$PROJECT_ID" --region=us-central
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Add bindings
|
||||
|
||||
# roles/storage.objectAdmin
|
||||
|
||||
# The following is hard to automate, so echo
|
||||
echo "Done! It may take up to 10 minutes for some of the changes to fully propagate."
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1,2 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
unsupported
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1,2 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
unsupported
|
|
@ -1,2 +1,2 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
unsupported
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
|
@ -1,2 +1,2 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
unsupported
|
|
@ -1,2 +1 @@
|
|||
cloud/gcp
|
||||
unsupported
|
||||
cloud/gcp
|
Loading…
Add table
Reference in a new issue