Skip to content

Commit

Permalink
tests: set skip_if_unavailable in test repos
Browse files Browse the repository at this point in the history
dnf seems to have changed the default for skip_if_unavailable. Some
mock repositories are still around in later tests, which then fail
because metadata cannot be synced.

Also expose skip_if_unavailable in dnf_repo_to_file_repo(), so that
tests checking for equality of repo files continue to pass.
  • Loading branch information
larskarlitski committed Jul 8, 2019
1 parent fce196a commit 5463e1a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pylorax/api/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ def dnf_repo_to_file_repo(repo):
if repo.gpgkey:
repo_str += "gpgkey = %s\n" % ",".join(repo.gpgkey)

if repo.skip_if_unavailable:
repo_str += "skip_if_unavailable=1\n"

return repo_str

def repo_to_source(repo, system_source):
Expand Down
1 change: 1 addition & 0 deletions tests/pylorax/repos/baseurl-test.repo
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ name = A fake repo with a baseurl
baseurl = https://fake-repo.base.url
sslverify = True
gpgcheck = True
skip_if_unavailable=1
1 change: 1 addition & 0 deletions tests/pylorax/repos/metalink-test.repo
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ name = A fake repo with a metalink
metalink = https://fake-repo.metalink
sslverify = True
gpgcheck = True
skip_if_unavailable=1
1 change: 1 addition & 0 deletions tests/pylorax/repos/mirrorlist-test.repo
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ name = A fake repo with a mirrorlist
mirrorlist = https://fake-repo.mirrorlist
sslverify = True
gpgcheck = True
skip_if_unavailable=1

0 comments on commit 5463e1a

Please sign in to comment.