Skip to content

Commit

Permalink
Ensure consistent use of the local plugin dir
Browse files Browse the repository at this point in the history
  • Loading branch information
marun committed Jan 16, 2025
1 parent 0946fdc commit 6612be5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scripts/build_antithesis_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ else
echo "Generating compose configuration for ${TEST_SETUP}"
gen_antithesis_compose_config "${IMAGE_TAG}" "${AVALANCHE_PATH}/tests/antithesis/xsvm/gencomposeconfig" \
"${AVALANCHE_PATH}/build/antithesis/xsvm" \
"AVALANCHEGO_PATH=${AVALANCHE_PATH}/build/avalanchego AVALANCHEGO_PLUGIN_DIR=${HOME}/.avalanchego/plugins"
"AVALANCHEGO_PATH=${AVALANCHE_PATH}/build/avalanchego AVAGO_PLUGIN_DIR=${AVALANCHE_PATH}/build/plugins"

build_antithesis_images_for_avalanchego "${TEST_SETUP}" "${IMAGE_PREFIX}" "${AVALANCHE_PATH}/vms/example/xsvm/Dockerfile"
fi
17 changes: 11 additions & 6 deletions tests/antithesis/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,29 @@ import (

const bootstrapIndex = 0

const (
targetPathEnvName = "TARGET_PATH"
imageTagEnvName = "IMAGE_TAG"
)

var (
errTargetPathEnvVarNotSet = errors.New("TARGET_PATH environment variable not set")
errImageTagEnvVarNotSet = errors.New("IMAGE_TAG environment variable not set")
errAvalancheGoEvVarNotSet = errors.New("AVALANCHEGO_PATH environment variable not set")
errPluginDirEnvVarNotSet = errors.New("AVALANCHEGO_PLUGIN_DIR environment variable not set")
errTargetPathEnvVarNotSet = errors.New(targetPathEnvName + " environment variable not set")
errImageTagEnvVarNotSet = errors.New(imageTagEnvName + " environment variable not set")
errAvalancheGoEvVarNotSet = errors.New(tmpnet.AvalancheGoPathEnvName + " environment variable not set")
errPluginDirEnvVarNotSet = errors.New(tmpnet.AvalancheGoPluginDirEnvName + " environment variable not set")
)

// Creates docker compose configuration for an antithesis test setup. Configuration is via env vars to
// simplify usage by main entrypoints. If the provided network includes a subnet, the initial DB state for
// the subnet will be created and written to the target path. The runtimePluginDir should be set if the node
// image used for the test setup uses a path other than the default (~/.avalanchego/plugins).
func GenerateComposeConfig(network *tmpnet.Network, baseImageName string, runtimePluginDir string) error {
targetPath := os.Getenv("TARGET_PATH")
targetPath := os.Getenv(targetPathEnvName)
if len(targetPath) == 0 {
return errTargetPathEnvVarNotSet
}

imageTag := os.Getenv("IMAGE_TAG")
imageTag := os.Getenv(imageTagEnvName)
if len(imageTag) == 0 {
return errImageTagEnvVarNotSet
}
Expand Down

0 comments on commit 6612be5

Please sign in to comment.