access-engine/internal/adapters/topaz/integration_test.go
tegwick 16ca97b277
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / container-smoke (push) Successful in 2s
Build and Publish Container Image / build-and-push (push) Failing after 1m2s
Complete renamed image source and verify bounded consumer migration readiness
Assistant: codex
Assistant-Model: gpt-6.1-sol
Assistant-Session: 01a126e1-76f8-7643-8cf3-e93336539ade
2026-10-11 23:25:19 +02:00

32 lines
952 B
Go

package topaz_test
import (
"os"
"os/exec"
"path/filepath"
"testing"
)
func TestTopazDockerComposeExample(t *testing.T) {
enabled := os.Getenv("ACCESS_ENGINE_RUN_TOPAZ_INTEGRATION")
if enabled == "" && os.Getenv("FLEX_AUTH_RUN_TOPAZ_INTEGRATION") == "1" {
t.Log("FLEX_AUTH_RUN_TOPAZ_INTEGRATION is deprecated; use ACCESS_ENGINE_RUN_TOPAZ_INTEGRATION=1 (FLEX-WP-0036)")
enabled = "1"
}
if enabled != "1" {
t.Skip("set ACCESS_ENGINE_RUN_TOPAZ_INTEGRATION=1 to run the examples/topaz docker-compose integration")
}
dir := filepath.Join("..", "..", "..", "examples", "topaz")
cmd := exec.Command("docker", "compose", "up", "--abort-on-container-exit", "--exit-code-from", "probe")
cmd.Dir = dir
output, err := cmd.CombinedOutput()
t.Cleanup(func() {
down := exec.Command("docker", "compose", "down", "-v")
down.Dir = dir
down.Run()
})
if err != nil {
t.Fatalf("docker compose integration failed: %v\n%s", err, output)
}
}