fix(test): require actual isolated MQ integration passes

This commit is contained in:
2026-09-30 14:13:26 +08:00
parent 86ce7c1de0
commit 0174cb6bd9
2 changed files with 16 additions and 3 deletions
+15 -3
View File
@@ -51,6 +51,18 @@ if ! docker exec -u rabbitmq "$name" rabbitmqctl add_user saas_mock "$saas_pw" >
fi
export RABBITMQ_URL="amqp://dispatcher_mock:${d_pw}@127.0.0.1:${port}/"
export RABBITMQ_PROVISIONER_URL="amqp://saas_mock:${saas_pw}@127.0.0.1:${port}/"
go test -tags=integration ./internal/mq -run '^TestCurrentBrokerSharedResultQueueAndNoConfigure$' -count=1 -v
go test -tags=integration ./internal/dispatcher -run '^TestCurrentRuntimeIsolated' -count=1 -v
go test -tags=integration ./cmd/sip-go-agent -run '^TestCurrentDispatcherCommandStartsWithIsolatedMQHTTPAndAgent$' -count=1 -v
run_required_test() {
local package=$1 test_name=$2 output
if ! output=$(go test -tags=integration "$package" -run "^${test_name}$" -count=1 -v 2>&1); then
printf '%s\n' "$output"
return 1
fi
printf '%s\n' "$output"
if ! grep -Fq -- "--- PASS: ${test_name} (" <<<"$output"; then
echo "isolated RabbitMQ Mock blocked: required test ${test_name} did not pass" >&2
return 1
fi
}
run_required_test ./internal/mq TestBrokerSharedResultQueueAndNoConfigure
run_required_test ./internal/dispatcher TestRuntimeIsolatedControlBacklogExecuteAndSharedResult
run_required_test ./cmd/sip-go-agent TestCurrentDispatcherCommandStartsWithIsolatedMQHTTPAndAgent