pulumi / ci-mgmt

Configuration for all things CI
Apache License 2.0
11 stars 4 forks source link

Enable cloud creds for the prerequisites job for bridged providers #675

Open t0yv0 opened 1 year ago

t0yv0 commented 1 year ago

Quick-running tests that require credentials need a place to run in CI for bridged providers.

This blocks https://github.com/pulumi/pulumi-gcp/pull/1264

Recently ci-mgmt introduced a change to run unit tests on the ./provider module as part of prerequisites. This is a great place to run tests of this form because the Go build caches are hot and these tests are fast to run, if they fail they block off the more significant test matrix jobs.

There are tests that are not quite unit but not full integration either.

The concrete proposal here is to run these tests as part of prerequisites job in CI also, by editing this job to establish cloud credentials for the runner.

t0yv0 commented 1 year ago

CC @danielrbradley

mjeffryes commented 1 year ago

Do we really need credentials for these kinds of tests? I've been using a script I cribbed from one of Ian's reviews to force my tests to use local state.

export PULUMI_CONFIG_PASSPHRASE=""
mkdir -p state
pulumi login --cloud-url "file://$PWD/state"
pulumi stack select organization/test/test --create
# pulumi up or whatever here
pulumi stack rm --yes
pulumi logout
rm -Rf "$PWD/state"

Though perhaps that's all you meant by setting up credentials

mjeffryes commented 1 year ago

Oh, I'm realizing now that you mean setting up the GCP credentials. I'm still confused why we need credentials for GCP to run what are essentially local only tests

t0yv0 commented 1 year ago

It's very unfortunate that creds are required for these tests. But the provider does a creds check too eagerly. We could maybe figure out a way to skip creds check in a test context.