From 5424aa973736507098d18ecbdba7698432ce9bad Mon Sep 17 00:00:00 2001 From: Jean-Paul Calderone Date: Tue, 17 Jan 2023 09:27:17 -0500 Subject: [PATCH] Only run the very slow new integration test in one CI job --- .circleci/config.yml | 15 +++++++++++++++ integration/conftest.py | 16 ++++++++++++++++ integration/test_vectors.py | 1 + 3 files changed, 32 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 43c309133..78c60daa9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,6 +94,8 @@ workflows: {} - "integration": + # Run even the slow integration tests here. + tox-args: "--runslow" requires: # If the unit test suite doesn't pass, don't bother running the # integration tests. @@ -294,6 +296,14 @@ jobs: integration: <<: *DEBIAN + + parameters: + tox-args: + description: >- + Additional arguments to pass to the tox command. + type: string" + default: "" + docker: - <<: *DOCKERHUB_AUTH image: "tahoelafsci/debian:11-py3.9" @@ -306,6 +316,11 @@ jobs: # Disable artifact collection because py.test can't produce any. ARTIFACTS_OUTPUT_PATH: "" + # Pass on anything we got in our parameters. Passing an arguments here + # disables the default "integration" argument defined in the tox env, so + # also stick "integration" in here. + TAHOE_LAFS_TOX_ARGS: "<< parameters.tox-args >> integration" + steps: - "checkout" # DRY, YAML-style. See the debian-9 steps. diff --git a/integration/conftest.py b/integration/conftest.py index 47c8155b3..dc0107eea 100644 --- a/integration/conftest.py +++ b/integration/conftest.py @@ -62,6 +62,22 @@ def pytest_addoption(parser): help=("If set, force Foolscap only for the storage protocol. " + "Otherwise HTTP will be used.") ) + parser.addoption( + "--runslow", action="store_true", default=False, + dest="runslow", + help="If set, run tests marked as slow.", + ) + +def pytest_collection_modifyitems(session, config, items): + if not config.option.runslow: + # The --runslow option was not given; keep only collected items not + # marked as slow. + items[:] = [ + item + for item + in items + if item.get_closest_marker("slow") is None + ] @pytest.fixture(autouse=True, scope='session') diff --git a/integration/test_vectors.py b/integration/test_vectors.py index cd5e808c6..27888e095 100644 --- a/integration/test_vectors.py +++ b/integration/test_vectors.py @@ -95,6 +95,7 @@ def test_convergence(convergence): assert len(convergence) == 16, "Convergence secret must by 16 bytes" +@mark.slow @mark.parametrize('case_and_expected', vectors.capabilities.items()) @ensureDeferred async def test_capability(reactor, request, alice, case_and_expected):