diff options
| author | mo khan <mo@mokhan.ca> | 2025-08-14 11:54:52 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-08-14 11:54:52 -0600 |
| commit | 9e55e65ac5eb6ff645880ee253a33f6ab138b615 (patch) | |
| tree | 3a55344b8c589f52687200c0beb5cd92688014fa /test/integration/container.go | |
| parent | 3f228b16c758d377566f11d2d328d1ccf658a2ad (diff) | |
Fix the broken build by running pg as a separate container.
Improve shell scripts and remove /sparkles/restore endpoint
- Add error handling and debugging to shell scripts with `set -e` and `DEBUG` flag
- Ensure scripts run from project root with `cd "$(dirname "$0")/.."`
- Remove `/sparkles/restore` endpoint from public routes and Envoy config
- Add Postgres test container support for integration tests
- Update CI configuration with newer Runway version and improved test setup
- Simplify Makefile by removing redundant commands
-------
:robot: Commit message generated by GitLab Duo
Diffstat (limited to 'test/integration/container.go')
| -rw-r--r-- | test/integration/container.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/integration/container.go b/test/integration/container.go index 67d7603..c95bdfd 100644 --- a/test/integration/container.go +++ b/test/integration/container.go @@ -10,6 +10,7 @@ import ( "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/log" + "github.com/testcontainers/testcontainers-go/modules/postgres" "github.com/testcontainers/testcontainers-go/wait" "github.com/xlgmokha/x/pkg/env" ) @@ -34,3 +35,18 @@ func NewContainer(t *testing.T, ctx context.Context, envVars map[string]string) require.NoError(t, err) return container } + +func NewPgContainer(ctx context.Context, t *testing.T) *postgres.PostgresContainer { + container, err := postgres.Run(ctx, "postgres:17", + postgres.WithDatabase("sparkle_test"), + postgres.WithUsername("postgres"), + postgres.WithPassword("secret"), + testcontainers.WithLogConsumers(&Logger{TB: t}), + testcontainers.WithLogger(log.TestLogger(t)), + testcontainers.WithWaitStrategy( + wait.ForListeningPort("5432/tcp"), + ), + ) + require.NoError(t, err) + return container +} |
