google.cloud/CONTRIBUTING.md
Yusuke Tsutsumi c5723b214f
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
2022-10-04 21:04:32 +00:00

59 lines
No EOL
1.6 KiB
Markdown

# Contributing to the google.cloud collection
## Workflow summary
1. [Clone the repository](#cloning).
1. Make the desired code change.
1. [Run integration tests locally and ensure they pass](running-integration-tests).
1. Create a PR.
## Cloning
The `ansible-test` command expects that the repository is in a directory that matches it's collection,
under a directory `ansible_collections`. Clone ensuring that hierarchy:
```shell
mkdir -p $TARGET_DIR/ansible_collections/google
git clone <url> $TARGET_DIR/collections/google/cloud
```
## Running tests
### prequisites for all tests
- Install the `ansible` package.
## Running integration tests
### Integration testing prequisites
#### Installing personal GCP credentials
The integration tests for this module require the use of real GCP credentials, and must provide
ansible-test those values. They can be added by authoring the following in `tests/integration/cloud-config-gcp.ini`:
```
[default]
gcp_project: @PROJECT_ID
gcp_cred_file: @CRED_FILE
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).