Skip to content
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: allow user to specify/override outputs from the setup stage #1741

Merged
merged 16 commits into from
Sep 22, 2023

Conversation

muncus
Copy link
Contributor

@muncus muncus commented Aug 1, 2023

Allow user to specify/override outputs from Setup stage. This enables users to iterate quickly when running blueprint tests on an existing project.

cft --stage verify --setup-var key=value

These values are then accessible with tft.GetTFSetupStringOutput("key"), as if it had come from the setup stage. Values specified in this way take precedence over actual setup outputs.

Values are passed to the underlying go test command using a set of prefixed environment variables. So --setup-var key=value becomes CFT_SETUP_key=value, which is parsed in NewTFBlueprintTest.

This method currently works only for string values, but can be extended if desired.

@muncus muncus marked this pull request as ready for review August 1, 2023 23:18
@muncus
Copy link
Contributor Author

muncus commented Aug 8, 2023

chatted with @bharathkkb out of band, and he suggested some changes. i'll move this to draft until its ready again.

@muncus muncus marked this pull request as draft August 8, 2023 19:24
@muncus muncus changed the title feat: manually set Setup stage outputs on the 'go test' commandline feat: allow user to specify/override outputs from the setup stage Aug 14, 2023
@muncus muncus marked this pull request as ready for review August 18, 2023 22:41
@apeabody
Copy link
Collaborator

apeabody commented Sep 6, 2023

/gcbrun

@muncus
Copy link
Contributor Author

muncus commented Sep 11, 2023

Hey folks, can i get another /gcbrun on this PR?
I've fixed the trailing whitespace, so this should be passing all the status checks.

@apeabody
Copy link
Collaborator

/gcbrun

@muncus
Copy link
Contributor Author

muncus commented Sep 12, 2023

Tests are green. Is there anything else needed before this PR can be merged?

If not, please merge it for me, as I do not have write permissions in this repo. Thanks!

@apeabody
Copy link
Collaborator

/gcbrun

@apeabody
Copy link
Collaborator

@bharathkkb - It sounds like you are familiar with the goal, would you have time to review?

Copy link
Member

@bharathkkb bharathkkb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding this!

@muncus
Copy link
Contributor Author

muncus commented Sep 21, 2023

I resolved a merge conflict, so this will need another /gcbrun to get the 'cloud-foundation-cicd' tests run again. Once they pass, please merge.

@apeabody
Copy link
Collaborator

/gcbrun

@apeabody apeabody merged commit 8365efb into GoogleCloudPlatform:master Sep 22, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants