Skip to content

External contributors cannot pass the test commands in contributing.md #1483

@pokutuna

Description

@pokutuna

This is a guide to run tests provided in contributing.md

dataform/contributing.md

Lines 35 to 43 in f58bbdd

### Test
The following command runs all unit tests:
```bash
bazel test --build_tests_only -- ... -tests/integration/...
```
This runs all tests excluding those that rely on encrypted secrets. If you need to run integration tests, please [get in touch](mailto:[email protected]) with the team.

However, it fails with the following output:

ERROR: /home/pokutuna/dataform/test_credentials/BUILD:5:14: Action test_credentials/bigquery.json failed: (Exit 1): gcloud failed: error executing command external/gcloud_sdk/bin/gcloud kms decrypt '--ciphertext-file=test_credentials/bigquery.json.enc' '--plaintext-file=bazel-out/k8-py2-fastbuild/bin/test_credentials/bigquery.json' ... (remaining 4 arguments skipped)
 ERROR: (gcloud.kms.decrypt) PERMISSION_DENIED: Request had insufficient authentication scopes.
 - '@type': type.googleapis.com/google.rpc.ErrorInfo
   domain: googleapis.com
   metadata:
     method: google.cloud.kms.v1.KeyManagementService.Decrypt
     service: cloudkms.googleapis.com
   reason: ACCESS_TOKEN_SCOPE_INSUFFICIENT

This command runs all tests except those depending on secrets. But the tests under the tests/cli/ also rely on Cloud KMS.
As a result, external contributors cannot run these tests.

This line is depending on a secret.

"//test_credentials:bigquery.json",

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions