-
Notifications
You must be signed in to change notification settings - Fork 662
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
[antithesis] Refactor compose config generation to simplify reuse #3184
Conversation
444ab35
to
bf44343
Compare
tests/antithesis/compose.go
Outdated
if len(targetPath) == 0 { | ||
return errors.New("TARGET_PATH environment variable not set") | ||
} | ||
|
||
imageTag := os.Getenv("IMAGE_TAG") | ||
if len(imageTag) == 0 { | ||
return errors.New("IMAGE_TAG environment variable not set") | ||
} | ||
|
||
// Subnet testing requires creating an initial db state for the bootstrap node | ||
if len(network.Subnets) > 0 { | ||
avalancheGoPath := os.Getenv("AVALANCHEGO_PATH") | ||
if len(avalancheGoPath) == 0 { | ||
return errors.New("AVALANCHEGO_PATH environment variable not set") | ||
} | ||
|
||
pluginDir := os.Getenv("AVALANCHEGO_PLUGIN_DIR") | ||
if len(pluginDir) == 0 { | ||
return errors.New("AVALANCHEGO_PLUGIN_DIR environment variable not set") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than using errors.New
directly in the return
- can we define them as variables? There is a longstanding goal I've had to add goerr113
as a linter... But there have been a few blockers (but this would be prevented by that linter)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I forget, why is this important?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case it isn't super important (more of a consistency style thing). But in other locations it's important to be able to test the different error conditions more naturally (with errors.Is
)
1ecdfec
to
7fee75d
Compare
Why this should be merged
Refactor generation of compose configuration for antithesis test setups to simplify reuse by subnet-evm.
How this works
Creates a new function (
GenerateComposeConfig
) that encapsulates generation of docker-compose.yml and associated initial db state (if testing a VM) for any antithesis test setup.How this was tested
CI