Skip to content

Commit

Permalink
cloudapi: update test to use repos from images
Browse files Browse the repository at this point in the history
This commit updates the cloudapi test that uses the real repositories
to use the version of those from the "images" library. Composer
no longer carries the default repos.

Note that this can most likely be simplified once
osbuild/images#1179
is merged.
  • Loading branch information
mvo5 committed Jan 30, 2025
1 parent 7955523 commit 68b18bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions internal/cloudapi/v2/compose_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package v2

import (
"io/fs"
"testing"

"github.com/osbuild/images/data/repositories"
"github.com/osbuild/images/pkg/customizations/subscription"
"github.com/osbuild/images/pkg/disk"
"github.com/osbuild/images/pkg/distrofactory"
Expand Down Expand Up @@ -811,9 +813,9 @@ func TestGetImageRequests_NoRepositories(t *testing.T) {
Repositories: []Repository{},
},
}
// NOTE: current directory is the location of this file, back up so it can use ./repositories/
rr, err := reporegistry.New([]string{"../../../"})
reposConf, err := reporegistry.LoadAllRepositoriesFromFS([]fs.FS{repos.FS})
require.NoError(t, err)
rr := reporegistry.NewFromDistrosRepoConfigs(reposConf)
got, err := request.GetImageRequests(distrofactory.NewDefault(), rr)
assert.NoError(t, err)
require.Len(t, got, 1)
Expand All @@ -837,9 +839,9 @@ func TestGetImageRequests_BlueprintDistro(t *testing.T) {
Distro: common.ToPtr("fedora-39"),
},
}
// NOTE: current directory is the location of this file, back up so it can use ./repositories/
rr, err := reporegistry.New([]string{"../../../"})
reposConf, err := reporegistry.LoadAllRepositoriesFromFS([]fs.FS{repos.FS})
require.NoError(t, err)
rr := reporegistry.NewFromDistrosRepoConfigs(reposConf)
got, err := request.GetImageRequests(distrofactory.NewDefault(), rr)
assert.NoError(t, err)
require.Len(t, got, 1)
Expand Down

0 comments on commit 68b18bb

Please sign in to comment.