Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/integration/cmd/angular/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (t *Test) Run(ctx context.Context, client *dagger.Client) (*dagger.Containe

// Build the CLI in a Go container
cli := client.Container().
From("golang:1.24-alpine").
From(integration.GoBaseImage).
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "build", "-o", "cli", "./cmd/openfeature"})
Expand Down
2 changes: 1 addition & 1 deletion test/integration/cmd/csharp/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (t *Test) Run(ctx context.Context, client *dagger.Client) (*dagger.Containe

// Build the CLI
cli := client.Container().
From("golang:1.24-alpine").
From(integration.GoBaseImage).
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "build", "-o", "cli", "./cmd/openfeature"})
Expand Down
16 changes: 10 additions & 6 deletions test/integration/cmd/go/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ func (t *Test) Run(ctx context.Context, client *dagger.Client) (*dagger.Containe
Include: []string{"test.go", "go.mod"},
})

// goBase returns a Go container with git installed, used both to build
// the CLI and to compile the generated client against the test fixture.
goBase := func() *dagger.Container {
return client.Container().
From(integration.GoBaseImage).
WithExec([]string{"apk", "add", "--no-cache", "git"})
}

// Build the CLI
cli := client.Container().
From("golang:1.24-alpine").
WithExec([]string{"apk", "add", "--no-cache", "git"}).
cli := goBase().
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "mod", "tidy"}).
Expand All @@ -56,9 +62,7 @@ func (t *Test) Run(ctx context.Context, client *dagger.Client) (*dagger.Containe
generatedFiles := generated.Directory("/tmp/generated")

// Test Go compilation with the generated files
goContainer := client.Container().
From("golang:1.24-alpine").
WithExec([]string{"apk", "add", "--no-cache", "git"}).
goContainer := goBase().
WithWorkdir("/app").
WithDirectory("/app", testFiles).
WithDirectory("/app/openfeature", generatedFiles).
Expand Down
2 changes: 1 addition & 1 deletion test/integration/cmd/nodejs/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func (t *Test) Run(ctx context.Context, client *dagger.Client) (*dagger.Containe
})

cli := client.Container().
From("golang:1.24-alpine").
From(integration.GoBaseImage).
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "build", "-o", "cli", "./cmd/openfeature"})
Expand Down
5 changes: 5 additions & 0 deletions test/integration/integration.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import (
"dagger.io/dagger"
)

// GoBaseImage is the Go container image used to build the CLI inside
// integration test pipelines. Centralized here so the version is bumped
// in a single place when go.mod's required Go version changes.
const GoBaseImage = "golang:1.25-alpine"

// Test defines the interface for all integration tests
type Test interface {
// Run executes the integration test with the given Dagger client
Expand Down
5 changes: 3 additions & 2 deletions test/new-generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,10 @@ func (t *Test) Run(ctx context.Context, client *dagger.Client) (*dagger.Containe
Include: []string{"test_openfeature.py", "requirements.txt"},
})

// Build the CLI
// Build the CLI. Use integration.GoBaseImage so the Go version is
// bumped in a single place when go.mod changes.
cli := client.Container().
From("golang:1.24-alpine").
From(integration.GoBaseImage).
WithDirectory("/src", source).
WithWorkdir("/src").
WithExec([]string{"go", "build", "-o", "cli"})
Expand Down
Loading