google.cloud/CONTRIBUTING.md
Yusuke Tsutsumi 76677279f0
Adding integration tests on PRs (#502)
To help catch issues from PRs that would regress behavior,
adding a GitHub action similar to unit tests to run integration
tests.

GitHub actions do not pass secrets to actions which are triggered
by PRs sent from forks. As a result, it is not possible to have CI
run on the forks from external contributors. Currently implementing a
process that requires manual review until a more direct solution is
found.

Adding some basic instructions for future maintainers and contributors.
2022-10-01 18:23:22 +00:00

1.2 KiB

Contributing to the google.cloud collection

Workflow summary

  1. Clone the repository.
  2. Make the desired code change.
  3. Run integration tests locally and ensure they pass.
  4. 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:

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

Running

Run ansible-test integration. Currently some tests are disabled as test are being verified and added.