-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adding tests for the major submodules #3
Conversation
/gcbrun |
@gautambaghel - take a look at these errors from the int test run: https://gist.github.com/g-awmalik/813e6b8a277dd8f7f9d84dec4230e6dc It seems like you're not setting the TFC org name & the image name in the examples. |
There are a couple of ways we can do this:
|
@g-awmalik - This is expected, we need to pass the TFC token and TFC org name somehow... The custom image however needs to be resolved, is there a way to create the image via the Cloudbuild pipeline? It's taken from the GH pipeline repo here -> https://github.com/terraform-google-modules/terraform-google-github-actions-runners/tree/master/examples/gh-runner-mig-native-packer I need to know from Bharath how he tests these... |
@g-awmalik - We'll do the first approach you recommended, it seems doable but it still won't work if the TFC login token is not present on the machine (because the TFE provider needs that)
|
These tests should run perfectly fine with a free Terraform Cloud account so if Google wants to create one and have complete ownership of it for security purposes I'm fine with it. |
I didn't realize the TFC token was part of this PR. For that we can use secrets with cloud build. Basically, you can set up the token and I'll put that in Secrets Manager in our CI/CD GCP that only the CI/CD service account will have access to. You'll just need to get it as an env var in the go test. However, TFC org name and image can still be set up as outputs since there's nothing sensitive there unless I'm mistaken. Let me know. |
Take a look at building images with cloud build. Basically, you'll need to add after |
@g-awmalik - Added the fixes in the new commit, two things that need to be done before the tests work
Thanks! |
The TFE_TOKEN secret can be used in relevant steps as: steps: - name: STEP_NAME ... secretEnv: ['TFE_TOKEN'] ...
@gautambaghel - the secret should be available in cloud build as an env var as soon as GoogleCloudPlatform/cloud-foundation-toolkit#1782 is applied. |
I think it's merged can you do a /gcbrun please? thx! |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
1 similar comment
/gcbrun |
/gcbrun |
1 similar comment
/gcbrun |
/gcbrun |
1 similar comment
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
1 similar comment
/gcbrun |
FYI: This won't work without a Terraform cloud org name and a token