-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathrunner.go
More file actions
32 lines (27 loc) · 1.08 KB
/
Copy pathrunner.go
File metadata and controls
32 lines (27 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package conex
import (
"context"
"testing"
)
// runner is an abstraction that allows running tests either natively on the host
// or inside a Docker container. This enables conex to work on systems where
// container IPs are not directly accessible from the host (e.g., Docker for Mac).
type runner interface {
// Run executes the test suite. The runner is responsible for setting up
// any necessary environment and executing m.Run().
Run(m *testing.M) int
// Box creates a container and returns a Container interface.
// The implementation determines how the container is accessed (direct IP vs network alias).
Box(t testing.TB, conf *Config, name string) Container
Pull(ctx context.Context, image string) error
Ensure(ctx context.Context, image string) (string, error)
Build(ctx context.Context, image string, tag string) error
}
// RunnerConfig holds configuration for creating a runner.
type runnerConfig struct {
Name string // prefix for container names
PullImages bool
Images []string
RetCode int
GoImage string // Go image for running tests in Docker runner
}