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

Alter BuildTargets and Setup function signatures to accept a struct with more info #138

Merged
merged 23 commits into from
Aug 7, 2023

Conversation

elliesterner
Copy link
Contributor

@elliesterner elliesterner commented Jul 20, 2023

Initially I wanted to simply send the VaultBenchmarkCoreConfig struct in this BuildTargets function. But the config package imports the benchmarktests package, so I couldn't import config into benchmarktests because it would be a circular dependency. Instaed, I created a new struct that lives in benchmarktests that represents the "top level" configuration (nothing test specific) called TopLevelTargetConfig.

This allows us to do more with our setup function. For example, check if the max_exp_jwt of the GCP role is less than the duration of the tests, an error will be returned immediately. (This GCP specific logic will be added in this follow up [PR])(#139).

2023-07-20T08:30:38.282-0500 [INFO]  vault-benchmark: setting up targets
2023-07-20T08:30:38.286-0500 [ERROR] vault-benchmark: target setup failed: GCP role max_jwt_exp (2s) cannot be shorter than benchmark test duration(20m0s)

@elliesterner elliesterner requested a review from a team as a code owner July 20, 2023 13:31
@elliesterner elliesterner requested review from jasonodonnell and ltcarbonell and removed request for a team July 20, 2023 13:31
@elliesterner elliesterner changed the title Alter setup struct Alter setup struct to detect if max_exp_jwt is less than benchmark test durations Jul 20, 2023
@elliesterner elliesterner changed the title Alter setup struct to detect if max_exp_jwt is less than benchmark test durations Alter BuiltTargets and Setup function signatures to accept a struct with more info Jul 20, 2023
@elliesterner elliesterner mentioned this pull request Jul 20, 2023
@elliesterner elliesterner changed the title Alter BuiltTargets and Setup function signatures to accept a struct with more info Alter BuildTargets and Setup function signatures to accept a struct with more info Jul 20, 2023
Copy link
Contributor

@davidadeleon davidadeleon left a comment

Choose a reason for hiding this comment

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

Good start! I do think there are some changes we may want to consider which I commented on.

benchmarktests/target_auth_gcp.go Outdated Show resolved Hide resolved
benchmarktests/target_auth_gcp.go Outdated Show resolved Hide resolved
benchmarktests/target_auth_gcp.go Outdated Show resolved Hide resolved
benchmarktests/target_auth_gcp.go Outdated Show resolved Hide resolved
benchmarktests/benchmark_targets.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@jasonodonnell jasonodonnell left a comment

Choose a reason for hiding this comment

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

One question but looks good to me!

Copy link
Contributor

@davidadeleon davidadeleon left a comment

Choose a reason for hiding this comment

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

Looks good!

@elliesterner elliesterner merged commit 19b41d0 into main Aug 7, 2023
26 checks passed
@elliesterner elliesterner deleted the alter-setup-struct branch August 9, 2023 11:23
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.

None yet

4 participants