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

slicer/test: Set archive options from release #82

Merged
merged 1 commit into from
Sep 17, 2023
Merged
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
16 changes: 11 additions & 5 deletions internal/slicer/slicer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,12 +527,12 @@ const defaultChiselYaml = `
`

type testArchive struct {
arch string
pkgs map[string][]byte
options archive.Options
pkgs map[string][]byte
}

func (a *testArchive) Options() *archive.Options {
return &archive.Options{Arch: a.arch}
return &a.options
}

func (a *testArchive) Fetch(pkg string) (io.ReadCloser, error) {
Expand Down Expand Up @@ -579,9 +579,15 @@ func (s *S) TestRun(c *C) {
pkgs[name] = deb
}
archives := map[string]archive.Archive{}
for name, _ := range release.Archives {
for name, setupArchive := range release.Archives {
archive := &testArchive{
arch: test.arch,
options: archive.Options{
Label: setupArchive.Name,
Version: setupArchive.Version,
Suites: setupArchive.Suites,
Components: setupArchive.Components,
Arch: test.arch,
},
pkgs: pkgs,
}
archives[name] = archive
Expand Down