From e7be8dbbcfe1a053d568c99cfeb2e921c3b1471a Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 20 Jul 2022 13:50:56 +0200 Subject: spack stage: add missing --fresh and --reuse (#31626) --- lib/spack/spack/cmd/stage.py | 1 + lib/spack/spack/test/cmd/stage.py | 11 +++++++++++ 2 files changed, 12 insertions(+) (limited to 'lib') diff --git a/lib/spack/spack/cmd/stage.py b/lib/spack/spack/cmd/stage.py index 8e039c832a..474efe375c 100644 --- a/lib/spack/spack/cmd/stage.py +++ b/lib/spack/spack/cmd/stage.py @@ -24,6 +24,7 @@ def setup_parser(subparser): subparser.add_argument( '-p', '--path', dest='path', help="path to stage package, does not add to spack tree") + arguments.add_concretizer_args(subparser) def stage(parser, args): diff --git a/lib/spack/spack/test/cmd/stage.py b/lib/spack/spack/test/cmd/stage.py index 5c586a11b0..5dec5ca3ff 100644 --- a/lib/spack/spack/test/cmd/stage.py +++ b/lib/spack/spack/test/cmd/stage.py @@ -8,6 +8,7 @@ import sys import pytest +import spack.config import spack.environment as ev import spack.repo from spack.main import SpackCommand @@ -122,3 +123,13 @@ def test_stage_full_env(mutable_mock_env_path, monkeypatch): # assert that all were staged assert len(expected) == 0 + + +@pytest.mark.disable_clean_stage_check +def test_concretizer_arguments(mock_packages, mock_fetch): + """Make sure stage also has --reuse and --fresh flags.""" + stage("--reuse", "trivial-install-test-package") + assert spack.config.get("concretizer:reuse", None) is True + + stage("--fresh", "trivial-install-test-package") + assert spack.config.get("concretizer:reuse", None) is False -- cgit v1.2.3-60-g2f50