Skip to content

Commit

Permalink
dnfjson: skip TestDepsolver() if no osbuild-depsolve-dnf is installed
Browse files Browse the repository at this point in the history
Do not fail if `osbuild-depsolve-dnf` is missing.
  • Loading branch information
mvo5 authored and achilleas-k committed Jan 12, 2024
1 parent 8e74dc6 commit c5d9511
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dnfjson/dnfjson.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func findDepsolveDnf() string {

// if it's not found, return empty string; the run() function will fail if
// it's used before setting.
return locations[0]
return ""
}

// Create a new unconfigured BaseSolver (without platform information). It can
Expand Down
8 changes: 8 additions & 0 deletions pkg/dnfjson/dnfjson_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ func TestDepsolver(t *testing.T) {
if !dnfInstalled() {
t.Skip()
}

if findDepsolveDnf() == "" {
t.Skip("Test needs an installed osbuild-depsolve-dnf")
}
}

s := rpmrepo.NewTestServer()
Expand Down Expand Up @@ -558,6 +562,10 @@ func TestErrorRepoInfo(t *testing.T) {
if !dnfInstalled() {
t.Skip()
}

if findDepsolveDnf() == "" {
t.Skip("Test needs an installed osbuild-depsolve-dnf")
}
}

assert := assert.New(t)
Expand Down

0 comments on commit c5d9511

Please sign in to comment.