Add e2e test using opentofu cli
This commit is contained in:
parent
bd06c2e4b3
commit
6b623eb3a3
8 changed files with 180 additions and 5 deletions
48
e2e-test/setup-dev.sh
Executable file
48
e2e-test/setup-dev.sh
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
echo "Setting up development environment for terraform-provider-tor..."
|
||||
|
||||
# Get the Go bin path
|
||||
GOBIN=$(go env GOPATH)/bin
|
||||
if [ -z "$GOBIN" ]; then
|
||||
GOBIN=$(go env GOROOT)/bin
|
||||
fi
|
||||
|
||||
echo "Go bin path: $GOBIN"
|
||||
|
||||
# Create local .terraformrc with dev overrides
|
||||
TERRAFORMRC="$(pwd)/.terraformrc"
|
||||
echo "Creating $TERRAFORMRC..."
|
||||
|
||||
# Create local .terraformrc with dev overrides
|
||||
cat > "$TERRAFORMRC" << EOF
|
||||
provider_installation {
|
||||
dev_overrides {
|
||||
"guardianproject/tor" = "$GOBIN"
|
||||
}
|
||||
direct {}
|
||||
}
|
||||
EOF
|
||||
|
||||
echo "✓ Created local $TERRAFORMRC with dev overrides"
|
||||
|
||||
# Build and install the provider
|
||||
echo "Building and installing provider..."
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
# Build with proper naming for dev overrides
|
||||
go build -o "$GOBIN/terraform-provider-tor_v99.0.0"
|
||||
|
||||
echo "✓ Provider built and installed to $GOBIN/terraform-provider-tor_v99.0.0"
|
||||
|
||||
echo ""
|
||||
echo "Setup complete! You can now run:"
|
||||
echo " cd e2e-test"
|
||||
echo " ./tf plan"
|
||||
echo " ./tf apply"
|
||||
echo ""
|
||||
echo "Or use the full command:"
|
||||
echo " TF_CLI_CONFIG_FILE=.terraformrc terraform plan"
|
||||
echo ""
|
||||
echo "Note: Using local .terraformrc to avoid modifying your global configuration."
|
Loading…
Add table
Add a link
Reference in a new issue