From 1645877beed25bf5e5d8aed849bd36c78f46ac08 Mon Sep 17 00:00:00 2001 From: Bryan Frimin Date: Mon, 1 Dec 2025 00:04:45 +0100 Subject: [PATCH] Fix github action container start Signed-off-by: Bryan Frimin --- .github/workflows/make.yaml | 82 ++++++++++--------------------- GNUmakefile | 4 +- compose.yaml | 7 ++- e2e/internal/testutil/testutil.go | 10 +++- 4 files changed, 43 insertions(+), 60 deletions(-) diff --git a/.github/workflows/make.yaml b/.github/workflows/make.yaml index 5ff6aeec0..5a1db27a8 100644 --- a/.github/workflows/make.yaml +++ b/.github/workflows/make.yaml @@ -97,53 +97,6 @@ jobs: runs-on: "ubuntu-22.04" permissions: contents: "read" - services: - postgres: - image: "postgres:17.4" - env: - POSTGRES_USER: "postgres" - POSTGRES_PASSWORD: "postgres" - ports: - - "5432:5432" - options: >- - --health-cmd "pg_isready -U postgres" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - minio: - image: "bitnami/minio:latest" - env: - MINIO_ROOT_USER: "probod" - MINIO_ROOT_PASSWORD: "thisisnotasecret" - MINIO_DEFAULT_BUCKETS: "probod-test" - ports: - - "9000:9000" - options: >- - --health-cmd "curl -f http://localhost:9000/minio/health/live || exit 1" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - mailpit: - image: "axllent/mailpit:latest" - env: - MP_DISABLE_VERSION_CHECK: "true" - MP_VERBOSE: "false" - MP_SMTP_AUTH_ACCEPT_ANY: "true" - MP_SMTP_AUTH_ALLOW_INSECURE: "true" - ports: - - "1025:1025" - chrome: - image: "chromedp/headless-shell:140.0.7259.2" - ports: - - "9222:9222" - pebble: - image: "ghcr.io/letsencrypt/pebble:latest" - env: - PEBBLE_VA_NOSLEEP: "1" - PEBBLE_WFE_NONCEREJECT: "0" - PEBBLE_VA_ALWAYS_VALID: "1" - ports: - - "14000:14000" steps: - uses: "actions/checkout@v4" - uses: "actions/setup-go@v5" @@ -152,14 +105,31 @@ jobs: - uses: "actions/setup-node@v4" with: node-version-file: ".nvmrc" + - run: "sudo apt-get install -y mkcert" + - run: "sudo mkcert -install" + - uses: "docker/setup-qemu-action@v3" + - uses: "docker/setup-buildx-action@v3" + - uses: "docker/setup-compose-action@v1" - run: "npm ci" - - name: "Setup PostgreSQL database" - env: - PGHOST: "localhost" - PGUSER: "postgres" - PGPASSWORD: "postgres" + - run: "make stack-up" + - run: "make stack-ps" + - name: "Inject root CA into e2e config" run: | - psql -c "CREATE DATABASE probod_test;" - - run: "make build" - - name: "Run e2e tests" - run: "make test-e2e" + # Use Python to properly inject the root CA PEM content into YAML + python3 << 'EOF' + import yaml + + with open('compose/pebble/certs/rootCA.pem', 'r') as f: + root_ca = f.read() + + with open('e2e/console/testdata/config.yaml', 'r') as f: + config = yaml.safe_load(f) + + config['probod']['custom-domains']['acme']['root-ca'] = root_ca + + with open('e2e/console/testdata/config.yaml', 'w') as f: + yaml.dump(config, f, default_flow_style=False, allow_unicode=True) + EOF + - run: "make test-e2e" + env: + PROBO_E2E_VERBOSE: "true" diff --git a/GNUmakefile b/GNUmakefile index 5339eebed..eda87a7b6 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -100,7 +100,7 @@ coverage-combined: coverage-report test-e2e-coverage ## Generate combined covera $(GO) tool cover -html=coverage-combined.out -o=coverage-combined.html .PHONY: build -build: @probo/emails @probo/console @probo/trust bin/probod +build: bin/probod .PHONY: sbom-docker sbom-docker: docker-build @@ -145,6 +145,8 @@ bin/probod: pkg/server/api/console/v1/schema/schema.go \ pkg/server/api/mcp/v1/server/server.go \ pkg/server/api/mcp/v1/types/types.go \ @probo/emails \ + @probo/console \ + @probo/trust \ vet $(GO_BUILD) -o $(PROBOD_BIN) $(PROBOD_SRC) diff --git a/compose.yaml b/compose.yaml index 6b5e93655..fcc228fff 100644 --- a/compose.yaml +++ b/compose.yaml @@ -14,7 +14,12 @@ services: environment: POSTGRES_USER: "postgres" POSTGRES_PASSWORD: "postgres" - + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 5s + timeout: 5s + retries: 5 + minio: image: "quay.io/minio/minio" entrypoint: "sh" diff --git a/e2e/internal/testutil/testutil.go b/e2e/internal/testutil/testutil.go index c77baa5fd..4e0f03d33 100644 --- a/e2e/internal/testutil/testutil.go +++ b/e2e/internal/testutil/testutil.go @@ -23,6 +23,7 @@ // // Optional environment variables: // - PROBO_E2E_COVERDIR: Directory for coverage data (enables coverage collection) +// - PROBO_E2E_VERBOSE: If set, outputs binary stdout/stderr for debugging // // Example usage: // @@ -114,8 +115,13 @@ func Setup() { } else { cmd.Env = os.Environ() } - cmd.Stdout = io.Discard - cmd.Stderr = io.Discard + if os.Getenv("PROBO_E2E_VERBOSE") != "" { + cmd.Stdout = os.Stdout + cmd.Stderr = os.Stderr + } else { + cmd.Stdout = io.Discard + cmd.Stderr = io.Discard + } testEnv.cmd = cmd