parent
11e3e332bd
commit
f6781d65f0
@ -416,11 +416,9 @@ def listspecs(args):
|
|||||||
"""list binary packages available from mirrors"""
|
"""list binary packages available from mirrors"""
|
||||||
specs = bindist.get_specs(args.force)
|
specs = bindist.get_specs(args.force)
|
||||||
if args.packages:
|
if args.packages:
|
||||||
pkgs = set(args.packages)
|
constraints = set(args.packages)
|
||||||
specs = [s for s in specs for p in pkgs if s.satisfies(p)]
|
specs = [s for s in specs if any(s.satisfies(c) for c in constraints)]
|
||||||
display_specs(specs, args, all_headers=True)
|
display_specs(specs, args, all_headers=True)
|
||||||
else:
|
|
||||||
display_specs(specs, args, all_headers=True)
|
|
||||||
|
|
||||||
|
|
||||||
def getkeys(args):
|
def getkeys(args):
|
||||||
|
@ -8,11 +8,19 @@
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
import spack.main
|
import spack.main
|
||||||
|
import spack.binary_distribution
|
||||||
|
|
||||||
buildcache = spack.main.SpackCommand('buildcache')
|
buildcache = spack.main.SpackCommand('buildcache')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture()
|
||||||
|
def mock_get_specs(database, monkeypatch):
|
||||||
|
specs = database.query_local()
|
||||||
|
monkeypatch.setattr(
|
||||||
|
spack.binary_distribution, 'get_specs', lambda x: specs
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(
|
@pytest.mark.skipif(
|
||||||
platform.system().lower() != 'linux',
|
platform.system().lower() != 'linux',
|
||||||
reason='implementation for MacOS still missing'
|
reason='implementation for MacOS still missing'
|
||||||
@ -20,3 +28,16 @@
|
|||||||
@pytest.mark.db
|
@pytest.mark.db
|
||||||
def test_buildcache_preview_just_runs(database):
|
def test_buildcache_preview_just_runs(database):
|
||||||
buildcache('preview', 'mpileaks')
|
buildcache('preview', 'mpileaks')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
platform.system().lower() != 'linux',
|
||||||
|
reason='implementation for MacOS still missing'
|
||||||
|
)
|
||||||
|
@pytest.mark.db
|
||||||
|
@pytest.mark.regression('13757')
|
||||||
|
def test_buildcache_list_duplicates(mock_get_specs, capsys):
|
||||||
|
with capsys.disabled():
|
||||||
|
output = buildcache('list', 'mpileaks', '@2.3')
|
||||||
|
|
||||||
|
assert output.count('mpileaks') == 3
|
||||||
|
Loading…
Reference in New Issue
Block a user