Skip to content

Commit b823635

Browse files
Add CTRF to the scenario tests (#3545)
* add some json ctrf improvements * fix -v * attempt to separate the output --------- Co-authored-by: Nedyalko Dyakov <[email protected]>
1 parent dfa7bd1 commit b823635

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

maintnotifications/e2e/scripts/run-e2e-tests.sh

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@ NC='\033[0m' # No Color
2323

2424
# Logging functions
2525
log_info() {
26-
echo -e "${BLUE}[INFO]${NC} $1"
26+
echo -e "${BLUE}[INFO]${NC} $1" >&2
2727
}
2828

2929
log_success() {
30-
echo -e "${GREEN}[SUCCESS]${NC} $1"
30+
echo -e "${GREEN}[SUCCESS]${NC} $1" >&2
3131
}
3232

3333
log_warning() {
34-
echo -e "${YELLOW}[WARNING]${NC} $1"
34+
echo -e "${YELLOW}[WARNING]${NC} $1" >&2
3535
}
3636

3737
log_error() {
38-
echo -e "${RED}[ERROR]${NC} $1"
38+
echo -e "${RED}[ERROR]${NC} $1" >&2
3939
}
4040

4141
# Help function
@@ -134,15 +134,14 @@ export FAULT_INJECTION_API_URL="$FAULT_INJECTOR_URL"
134134
export E2E_SCENARIO_TESTS="true"
135135

136136
# Build test command
137-
TEST_CMD="go test -tags=e2e -v"
137+
TEST_CMD="go test -json -tags=e2e"
138138

139139
if [[ -n "$TIMEOUT" ]]; then
140140
TEST_CMD="$TEST_CMD -timeout=$TIMEOUT"
141141
fi
142142

143-
if [[ -n "$VERBOSE" ]]; then
144-
TEST_CMD="$TEST_CMD $VERBOSE"
145-
fi
143+
# Note: -v flag is not compatible with -json output format
144+
# The -json format already provides verbose test information
146145

147146
if [[ -n "$RUN_PATTERN" ]]; then
148147
TEST_CMD="$TEST_CMD -run $RUN_PATTERN"
@@ -160,15 +159,15 @@ fi
160159

161160
# Show configuration
162161
log_info "Maintenance notifications E2E Tests Configuration:"
163-
echo " Repository Root: $REPO_ROOT"
164-
echo " E2E Directory: $E2E_DIR"
165-
echo " Config Path: $CONFIG_PATH"
166-
echo " Fault Injector URL: $FAULT_INJECTOR_URL"
167-
echo " Test Timeout: $TIMEOUT"
162+
echo " Repository Root: $REPO_ROOT" >&2
163+
echo " E2E Directory: $E2E_DIR" >&2
164+
echo " Config Path: $CONFIG_PATH" >&2
165+
echo " Fault Injector URL: $FAULT_INJECTOR_URL" >&2
166+
echo " Test Timeout: $TIMEOUT" >&2
168167
if [[ -n "$RUN_PATTERN" ]]; then
169-
echo " Test Pattern: $RUN_PATTERN"
168+
echo " Test Pattern: $RUN_PATTERN" >&2
170169
fi
171-
echo ""
170+
echo "" >&2
172171

173172
# Validate fault injector connectivity
174173
log_info "Checking fault injector connectivity..."
@@ -186,11 +185,11 @@ fi
186185
# Show what would be executed in dry-run mode
187186
if [[ "$DRY_RUN" == true ]]; then
188187
log_info "Dry run mode - would execute:"
189-
echo " cd $REPO_ROOT"
190-
echo " export REDIS_ENDPOINTS_CONFIG_PATH=\"$CONFIG_PATH\""
191-
echo " export FAULT_INJECTION_API_URL=\"$FAULT_INJECTOR_URL\""
192-
echo " export E2E_SCENARIO_TESTS=\"true\""
193-
echo " $TEST_CMD"
188+
echo " cd $REPO_ROOT" >&2
189+
echo " export REDIS_ENDPOINTS_CONFIG_PATH=\"$CONFIG_PATH\"" >&2
190+
echo " export FAULT_INJECTION_API_URL=\"$FAULT_INJECTOR_URL\"" >&2
191+
echo " export E2E_SCENARIO_TESTS=\"true\"" >&2
192+
echo " $TEST_CMD" >&2
194193
exit 0
195194
fi
196195

@@ -200,14 +199,14 @@ cd "$REPO_ROOT"
200199
# Run the tests
201200
log_info "Starting E2E tests..."
202201
log_info "Command: $TEST_CMD"
203-
echo ""
202+
echo "" >&2
204203

205204
if eval "$TEST_CMD"; then
206-
echo ""
205+
echo "" >&2
207206
log_success "All E2E tests completed successfully!"
208207
exit 0
209208
else
210-
echo ""
209+
echo "" >&2
211210
log_error "E2E tests failed!"
212211
log_info "Check the test output above for details"
213212
exit 1

0 commit comments

Comments
 (0)