Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin the package version with ~ rather than =. #1579

Merged
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
4 changes: 2 additions & 2 deletions pkg/build/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func (t *Test) Compile(ctx context.Context) error {

// Append the subpackage that we're testing to be installed.
version := fmt.Sprintf("%s-r%d", t.Configuration.Package.Version, t.Configuration.Package.Epoch)
te.Packages = append(te.Packages, sp.Name+"="+version)
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 @@ -97,7 +97,7 @@ func (t *Test) Compile(ctx context.Context) error {
te.Packages = append(te.Packages, t.Package)
} else {
version := fmt.Sprintf("%s-r%d", t.Configuration.Package.Version, t.Configuration.Package.Epoch)
te.Packages = append(te.Packages, t.Configuration.Package.Name+"="+version)
te.Packages = append(te.Packages, t.Configuration.Package.Name+"~"+version)
}

if err := test.CompilePipelines(ctx, sm, cfg.Test.Pipeline); err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/build/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ func TestCompileTest(t *testing.T) {
t.Fatalf("unexpected error: %v", err)
}

if got, want := test.Configuration.Test.Environment.Contents.Packages, []string{"main-base", "main=1.2.3-r4", "main-need"}; !slices.Equal(got, want) {
if got, want := test.Configuration.Test.Environment.Contents.Packages, []string{"main-base", "main~1.2.3-r4", "main-need"}; !slices.Equal(got, want) {
t.Errorf("main test packages: want %v, got %v", want, got)
}

if got, want := test.Configuration.Subpackages[0].Test.Environment.Contents.Packages, []string{"subpackage-base", "subpackage=1.2.3-r4", "subpackage-need"}; !slices.Equal(got, want) {
if got, want := test.Configuration.Subpackages[0].Test.Environment.Contents.Packages, []string{"subpackage-base", "subpackage~1.2.3-r4", "subpackage-need"}; !slices.Equal(got, want) {
t.Errorf("subpackage test packages: want %v, got %v", want, got)
}
}
Loading