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

use simple bash script to set BASE64 env var #12010

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions integration-tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test_node_migrations: install_gotestfmt ## Run all node migration tests.
go test -timeout 1h -count=1 -json $(args) ./migration 2>&1 | tee /tmp/gotest.log | gotestfmt

.PHONY: test_node_migrations_simulated
test_node_migrations_simulated: install_gotestfmt
test_node_migrations_simulated: install_gotestfmt
TEST_LOG_LEVEL="disabled" \
go test -timeout 1h -count=1 -json $(args) ./migration 2>&1 | tee /tmp/gotest.log | gotestfmt

Expand All @@ -145,30 +145,22 @@ test_node_migrations_simulated_verbose:
# Soak
.PHONY: test_soak_ocr
test_soak_ocr:
go test -v -count=1 -run TestOCRSoak ./soak

.PHONY: test_soak_ocr_simulated
test_soak_ocr_simulated:
. ./scripts/check_base64_env_var.sh
go test -v -count=1 -run TestOCRSoak ./soak

.PHONY: test_soak_forwarder_ocr
test_soak_forwarder_ocr:
go test -v -count=1 -run TestForwarderOCRSoak ./soak

.PHONY: test_soak_forwarder_ocr_simulated
test_soak_forwarder_ocr_simulated:
. ./scripts/check_base64_env_var.sh
go test -v -count=1 -run TestForwarderOCRSoak ./soak

.PHONY: test_soak_automation
test_soak_automation:
go test -v -run ^TestAutomationBenchmark$$ ./benchmark -count=1

.PHONY: test_soak_automation_simulated
test_soak_automation_simulated:
. ./scripts/check_base64_env_var.sh
go test -v -run ^TestAutomationBenchmark$$ ./benchmark -count=1

.PHONY: test_benchmark_automation
test_benchmark_automation: ## Run the automation benchmark tests
. ./scripts/check_base64_env_var.sh
go test -timeout 30m -v -run ^TestAutomationBenchmark$$ ./benchmark -count=1

.PHONY: test_reorg_automation
Expand Down
36 changes: 36 additions & 0 deletions integration-tests/scripts/check_base64_env_var.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/bin/bash

RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
WHITE='\033[0;37m'
NC='\033[0m' # No Color

echo
if [ ! -z "$BASE64_CONFIG_OVERRIDE" ]; then
echo "${GREEN}BASE64_CONFIG_OVERRIDE is set, it will be used.${NC}"
echo "Decoded content:"
echo
echo "$BASE64_CONFIG_OVERRIDE" | base64 --decode
echo
echo
echo "${GREEN}Press RETURN to confirm and continue...${NC} ${RED}or CTRL+C to exit${NC}"
read -r -n 1 key
else
echo "${YELLOW}BASE64_CONFIG_OVERRIDE is not set, checking for overrides.toml file...${NC}"
if [ -f "testconfig/overrides.toml" ]; then
echo "${GREEN}Found testconfig/overrides.toml file. Here's its content:${NC}"
echo
cat "testconfig/overrides.toml"
echo
echo
echo "${GREEN}Press RETURN to base64-encode it and run the test...${NC} ${RED}or CTRL+C to exit${NC}"
read -r -n 1 key
if [[ $key = "" ]]; then
export BASE64_CONFIG_OVERRIDE=$(cat testconfig/overrides.toml | base64)
fi
else
echo "${RED}testconfig/overrides.toml file does not exist. Please create it or set BASE64_CONFIG_OVERRIDE manually.${NC}"
echo
fi
fi
Loading