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
27 changes: 27 additions & 0 deletions cmd/image/lock_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"fmt"
"path/filepath"
"strings"
"testing"
Expand Down Expand Up @@ -126,3 +127,29 @@ func TestLocksCoverConfigs(t *testing.T) {
}
}
}

// The locks pin each recipe's package at the recipe's version and epoch: a recipe bumped without
// task lock builds a package the lock refuses, and apko on the release builder found out
// (construct-brand at r5, the lock at r4). CI's check, which builds no root.
func TestLocksPinRecipesAtTheirBuild(t *testing.T) {
t.Chdir("../..")
recipes, err := readRecipes("recipes")
if err != nil {
t.Fatal(err)
}
built := map[string]string{}
for _, r := range recipes {
built[r.Name] = fmt.Sprintf("%s-r%d", r.Version, r.Epoch)
}
for _, root := range lockedRoots {
l, err := readLockFile(root.Lock)
if err != nil {
t.Fatal(err)
}
for _, p := range l.Ours {
if want, ok := built[p.Name]; ok && p.Version != want {
t.Errorf("%s pins %s=%s, its recipe builds %s: task build -- <recipe>, then task lock", root.Lock, p.Name, p.Version, want)
}
}
}
}
2 changes: 1 addition & 1 deletion image/apko.lock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ contents:
- code=1.145.2-r0
- colord=1.4.8-r0
- colord-gtk=0.3.1-r0
- construct-brand=0_git20261005-r4
- construct-brand=0_git20261005-r5
- cracklib=2.10.4-r0
- cracklib-lang=2.10.4-r0
- cups-browsed=2.1.1-r1
Expand Down
Loading