From b45c92e533d322cc693e23b6c5a19e662237c12e Mon Sep 17 00:00:00 2001 From: Dmitry Rodionov Date: Thu, 6 Apr 2023 21:21:39 +0300 Subject: [PATCH] tests: exclude compatibility tests by default (#3975) This allows to skip compatibility tests based on `CHECK_ONDISK_DATA_COMPATIBILITY` environment variable. When the variable is missing (default) compatibility tests wont be run. --- .github/workflows/build_and_test.yml | 1 + test_runner/regress/test_compatibility.py | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 56c0aa8f9a..c096aef4a9 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -338,6 +338,7 @@ jobs: rerun_flaky: true env: TEST_RESULT_CONNSTR: ${{ secrets.REGRESS_TEST_RESULT_CONNSTR }} + CHECK_ONDISK_DATA_COMPATIBILITY: nonempty - name: Merge and upload coverage data if: matrix.build_type == 'debug' diff --git a/test_runner/regress/test_compatibility.py b/test_runner/regress/test_compatibility.py index e9dadb5348..be6e1a69b2 100644 --- a/test_runner/regress/test_compatibility.py +++ b/test_runner/regress/test_compatibility.py @@ -34,9 +34,15 @@ from pytest import FixtureRequest # - check_neon_works performs the test itself, feel free to add more checks there. # +check_ondisk_data_compatibility_if_enabled = pytest.mark.skipif( + os.environ.get("CHECK_ONDISK_DATA_COMPATIBILITY") is None, + reason="CHECK_ONDISK_DATA_COMPATIBILITY env is not set", +) + # Note: if renaming this test, don't forget to update a reference to it in a workflow file: # "Upload compatibility snapshot" step in .github/actions/run-python-test-set/action.yml +@check_ondisk_data_compatibility_if_enabled @pytest.mark.xdist_group("compatibility") @pytest.mark.order(before="test_forward_compatibility") def test_create_snapshot(neon_env_builder: NeonEnvBuilder, pg_bin: PgBin, test_output_dir: Path): @@ -81,6 +87,7 @@ def test_create_snapshot(neon_env_builder: NeonEnvBuilder, pg_bin: PgBin, test_o # Directory `test_output_dir / "compatibility_snapshot_pg14"` is uploaded to S3 in a workflow, keep the name in sync with it +@check_ondisk_data_compatibility_if_enabled @pytest.mark.xdist_group("compatibility") @pytest.mark.order(after="test_create_snapshot") def test_backward_compatibility( @@ -134,6 +141,7 @@ def test_backward_compatibility( ), "Breaking changes are allowed by ALLOW_BACKWARD_COMPATIBILITY_BREAKAGE, but the test has passed without any breakage" +@check_ondisk_data_compatibility_if_enabled @pytest.mark.xdist_group("compatibility") @pytest.mark.order(after="test_create_snapshot") def test_forward_compatibility(