Skip to content

Commit

Permalink
Pin the package version used during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lyoung-confluent committed Oct 10, 2024
1 parent 74ab7bd commit 57e3f4c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/build/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ func (t *Test) Compile(ctx context.Context) error {
te := &cfg.Subpackages[i].Test.Environment.Contents

// Append the subpackage that we're testing to be installed.
te.Packages = append(te.Packages, sp.Name)
version := fmt.Sprintf("%s-r%d", t.Configuration.Package.Version, t.Configuration.Package.Epoch)
te.Packages = append(te.Packages, sp.Name+"="+version)

if err := test.CompilePipelines(ctx, sm, sp.Test.Pipeline); err != nil {
return fmt.Errorf("compiling subpackage %q tests: %w", sp.Name, err)
Expand All @@ -95,7 +96,8 @@ func (t *Test) Compile(ctx context.Context) error {
if t.Package != "" {
te.Packages = append(te.Packages, t.Package)
} else {
te.Packages = append(te.Packages, t.Configuration.Package.Name)
version := fmt.Sprintf("%s-r%d", t.Configuration.Package.Version, t.Configuration.Package.Epoch)
te.Packages = append(te.Packages, t.Configuration.Package.Name+"="+version)
}

if err := test.CompilePipelines(ctx, sm, cfg.Test.Pipeline); err != nil {
Expand Down

0 comments on commit 57e3f4c

Please sign in to comment.