diff --git a/Jenkinsfile b/Jenkinsfile index 251f4d2bd27..47fbe52f3c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -183,7 +183,7 @@ pipeline { } } options { - timeout(time: 40, unit: 'MINUTES') + timeout(time: 45, unit: 'MINUTES') } steps { catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { diff --git a/docker/env/version b/docker/env/version index 597994c076a..bb6d42d42ef 100644 --- a/docker/env/version +++ b/docker/env/version @@ -1 +1 @@ -1.90-2025.1-scylla-driver-v3.29.9 +1.91-2025.1-pytest-xdist_2 diff --git a/requirements.in b/requirements.in index bda0fbbb9e1..af48da6738d 100644 --- a/requirements.in +++ b/requirements.in @@ -23,6 +23,7 @@ pyzmq==22.3.0 tenacity==8.0.1 pytest==7.2.0 pytest-random-order==1.0.4 +pytest-xdist==3.8.0 # parallel integration tests (sct.py integration-tests -n) moto==5.2.2 # AWS mocking for keystore unit tests tcconfig==0.29.1 mysql-connector-python==9.1.0 diff --git a/requirements.txt b/requirements.txt index ec988d6b1db..a8a6a49ea03 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ # This file was autogenerated by uv via the following command: -# uv pip compile requirements.in --generate-hashes +# uv pip compile requirements.in --generate-hashes --python-version 3.10 --output-file requirements.txt aenum==3.1.17 \ --hash=sha256:0dad0421b2fbe30e3fb623b2a0a23eff823407df53829d6a72595e7f76f3d872 \ --hash=sha256:8b883a37a04e74cc838ac442bdd28c266eae5bbf13e1342c7ef123ed25230139 \ @@ -296,6 +296,7 @@ boto3==1.28.4 \ # via # -r requirements.in # gimme-aws-creds + # moto boto3-stubs==1.28.4 \ --hash=sha256:7a68d2a456d995318a6237eb5c6039f63b6a9bf902f216ff2261f87015fbb1c3 \ --hash=sha256:a5b1cb7cdfd83f34b573c9af4eda80a62638f2ac78fae9c972721d3837e1b918 @@ -306,6 +307,7 @@ botocore==1.31.4 \ # via # awscli # boto3 + # moto # s3transfer botocore-stubs==1.42.41 \ --hash=sha256:9423110fb0e391834bd2ed44ae5f879d8cb370a444703d966d30842ce2bcb5f0 \ @@ -657,6 +659,7 @@ cryptography==46.0.7 \ # fido2 # google-auth # jwcrypto + # moto # msal # paramiko # pyjwt @@ -706,6 +709,10 @@ exceptiongroup==1.3.1 \ --hash=sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219 \ --hash=sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598 # via pytest +execnet==2.1.2 \ + --hash=sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd \ + --hash=sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec + # via pytest-xdist fabric==2.6.0 \ --hash=sha256:47f184b070272796fd2f9f0436799e18f2ccba4ee8ee587796fca192acd46cd2 \ --hash=sha256:7a71714b8b8f28cf828eceb155196f43ebac1bd4c849b7161ed5993d1cbcaa40 @@ -1252,7 +1259,9 @@ markupsafe==3.0.3 \ --hash=sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc \ --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a \ --hash=sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50 - # via jinja2 + # via + # jinja2 + # werkzeug mbstrdecoder==1.1.4 \ --hash=sha256:03dae4ec50ec0d2ff4743e63fdbd5e0022815857494d35224b60775d3d934a8c \ --hash=sha256:8105ef9cf6b7d7d69fe7fd6b68a2d8f281ca9b365d7a9b670be376b2e6c81b21 @@ -2000,10 +2009,15 @@ pytest==7.2.0 \ # via # -r requirements.in # pytest-random-order + # pytest-xdist pytest-random-order==1.0.4 \ --hash=sha256:6b2159342a4c8c10855bc4fc6d65ee890fc614cb2b4ff688979b008a82a0ff52 \ --hash=sha256:72279a7f823969e18b10e438950f58330d17e0fcffb57cbd7929770cd687ecb2 # via -r requirements.in +pytest-xdist==3.8.0 \ + --hash=sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88 \ + --hash=sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1 + # via -r requirements.in python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 @@ -2078,6 +2092,7 @@ pyyaml==6.0.1 \ # kubernetes # okta # pre-commit + # responses # scylla-driver pyzmq==22.3.0 \ --hash=sha256:08c4e315a76ef26eb833511ebf3fa87d182152adf43dedee8d79f998a2162a0b \ @@ -2144,12 +2159,14 @@ requests==2.32.2 \ # google-cloud-storage # jira # kubernetes + # moto # msal # msrest # pygithub # python-jenkins # requests-oauthlib # requests-toolbelt + # responses requests-oauthlib==2.0.0 \ --hash=sha256:7dd8a5c40426b779b0868c404bdef9768deccf22749cde15852df527e6269b36 \ --hash=sha256:b3dffaebd884d8cd778494369603a9e7b58d29111bf6b41bdc2dcd87203af4e9 @@ -2413,6 +2430,7 @@ urllib3==1.26.20 \ # kubernetes # pygithub # requests + # responses uv==0.2.24 \ --hash=sha256:06b95969d73c804bbee63fb1bde54d1a7570826b446a2b5b9136534ebf55a168 \ --hash=sha256:0ea783d55d10bd3cf619fc1a7cb3f14e3157ffaa578a6afa068d0257923a31a4 \ @@ -2556,7 +2574,9 @@ wrapt==2.1.2 \ xmltodict==1.0.4 \ --hash=sha256:6d94c9f834dd9e44514162799d344d815a3a4faec913717a9ecbfa5be1bb8e61 \ --hash=sha256:a4a00d300b0e1c59fc2bfccb53d7b2e88c32f200df138a0dd2229f842497026a - # via okta + # via + # moto + # okta yarl==1.23.0 \ --hash=sha256:03214408cfa590df47728b84c679ae4ef00be2428e11630277be0727eba2d7cc \ --hash=sha256:041b1a4cefacf65840b4e295c6985f334ba83c30607441ae3cf206a0eed1a2e4 \ diff --git a/sct.py b/sct.py index 882e828faaf..6e1fe34cbf4 100755 --- a/sct.py +++ b/sct.py @@ -1318,9 +1318,12 @@ def unit_tests(test, junit_xml): @cli.command("integration-tests", help="Run all the SCT internal integration-tests") -@click.option("-t", "--test", required=False, default="", help="Run specific test file from unit-tests directory") +@click.option( + "-t", "--test", required=False, default=[""], multiple=True, help="Run specific test file from unit-tests directory" +) +@click.option("-n", required=False, default=4, help="Sets number of parallel tests to run, default is 4") @click.option("--junit-xml", required=False, default="", help="Path to write JUnit XML report") -def integration_tests(test, junit_xml): +def integration_tests(test, n, junit_xml): get_test_config().logdir() add_file_logger() @@ -1336,7 +1339,17 @@ def integration_tests(test, junit_xml): ) local_cluster.setup_prerequisites() - args = ["-v", "-p", "no:warnings", "-m", "integration", "unit_tests/{}".format(test)] + args = [ + "-v", + "-p", + "no:warnings", + "-m", + "integration", + "--dist", + "loadgroup", + f"-n{n}", + *(f"unit_tests/{t}" for t in test), + ] if junit_xml: args.append(f"--junit-xml={junit_xml}") sys.exit(pytest.main(args)) diff --git a/sdcm/utils/version_utils.py b/sdcm/utils/version_utils.py index 75487b7f5c9..334ad48e466 100644 --- a/sdcm/utils/version_utils.py +++ b/sdcm/utils/version_utils.py @@ -612,13 +612,26 @@ def resolve_latest_repo_symlink(url: str) -> str: return resolved_url -def get_specific_tag_of_docker_image(docker_repo: str): +def get_specific_tag_of_docker_image(docker_repo: str, architecture: Literal["x86_64", "aarch64"] = "x86_64") -> str: + """ + Get the latest docker image tag from ScyllaDB S3 storage for given nightly docker repo. + + :param docker_repo: docker repository name, e.g. 'scylladb/scylla-nightly' + :param architecture: architecture of the docker image, either 'x86_64' or 'aarch64' (default: 'x86_64') + :return: docker image tag string if found + :raises ValueError: if docker repo is not supported or tag info cannot be found + """ + if docker_repo == "scylladb/scylla-nightly": product = "scylla" branch = "master" elif docker_repo == "scylladb/scylla-enterprise-nightly": product = "scylla-enterprise" - branch = "enterprise" + # The `enterprise` rolling branch stopped producing builds when + # enterprise development folded into the unified releases, and its + # relocatables are gone from downloads.scylladb.com. `enterprise-2024.1` + # is the only branch still publishing scylla-enterprise-nightly images. + branch = "enterprise-2024.1" else: raise ValueError(f"SCT doesn't support getting latest from {docker_repo}") @@ -632,9 +645,11 @@ def get_specific_tag_of_docker_image(docker_repo: str): # url-id: 2022-08-29T08:05:34Z # docker-image-name: scylla-nightly:5.2.0-dev-0.20220829.67c91e8bcd61 build_info = yaml.safe_load(res.content) - tag = build_info["docker-image-name"].split(":", maxsplit=1)[1] - LOGGER.debug("found %s for %s repo", tag, docker_repo) - return tag + if tag := build_info.get(f"docker-image-name-{architecture}", build_info.get("docker-image-name")): + tag = tag.split(":", maxsplit=1)[1] + LOGGER.debug("found %s for %s repo", tag, docker_repo) + return tag + raise ValueError(f"Cannot find docker image tag info in {build_url} for architecture={architecture}") def transform_non_semver_scylla_version_to_semver(scylla_version: str): diff --git a/unit_tests/integration/test_config_get_version_based_on_conf.py b/unit_tests/integration/test_config_get_version_based_on_conf.py index d92bc7e74fa..7c0ee029e6e 100644 --- a/unit_tests/integration/test_config_get_version_based_on_conf.py +++ b/unit_tests/integration/test_config_get_version_based_on_conf.py @@ -153,158 +153,6 @@ def test_baremetal(monkeypatch): assert not _is_enterprise -def test_unified_package(monkeypatch): - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "gce") - monkeypatch.setenv( - "SCT_UNIFIED_PACKAGE", - ( - "https://downloads.scylladb.com/unstable/scylla/master/relocatable/2023-11-13T03:04:27Z/" - "scylla-unified-5.5.0~dev-0.20231113.7b08886e8dd8.x86_64.tar.gz" - ), - ) - monkeypatch.setenv( - "SCT_GCE_IMAGE_DB", "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/family/centos-7" - ) - - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - # unified_package should auto-set use_preinstalled_scylla to False - assert conf.get("use_preinstalled_scylla") is False - - _version, _is_enterprise = conf.get_version_based_on_conf() - - assert "5.5.0" in _version - assert not _is_enterprise - - -def test_unified_package_aws_sets_ubuntu_user(monkeypatch): - """Test that unified_package on AWS forces ami_db_scylla_user='ubuntu'.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "aws") - monkeypatch.setenv( - "SCT_UNIFIED_PACKAGE", - ( - "https://downloads.scylladb.com/unstable/scylla/master/relocatable/2023-11-13T03:04:27Z/" - "scylla-unified-5.5.0~dev-0.20231113.7b08886e8dd8.x86_64.tar.gz" - ), - ) - monkeypatch.setenv("SCT_AMI_ID_DB_SCYLLA", "ami-test123") - monkeypatch.setenv("SCT_CONFIG_FILES", "internal_test_data/minimal_test_case.yaml") - - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - assert conf.get("use_preinstalled_scylla") is False - assert conf.get("ami_db_scylla_user") == "ubuntu" - - -@pytest.mark.parametrize( - "scylla_version, backend, expected_ami_ssm", - [ - pytest.param( - "relocatable:latest", - "aws", - "resolve:ssm:/aws/service/canonical/ubuntu/server/24.04/stable/current/amd64/hvm/ebs-gp3/ami-id", - id="relocatable-latest-aws-x86_64", - ), - pytest.param( - "relocatable:master:x86_64", - "aws", - "resolve:ssm:/aws/service/canonical/ubuntu/server/24.04/stable/current/amd64/hvm/ebs-gp3/ami-id", - id="relocatable-master-x86_64-aws", - ), - pytest.param( - "relocatable:master:aarch64", - "aws", - "resolve:ssm:/aws/service/canonical/ubuntu/server/24.04/stable/current/arm64/hvm/ebs-gp3/ami-id", - id="relocatable-master-aarch64-aws", - ), - pytest.param("relocatable:latest", "gce", None, id="relocatable-latest-gce"), - ], -) -def test_relocatable_version_resolves_unified_package(scylla_version, backend, expected_ami_ssm, monkeypatch): - """Test that relocatable: scylla_version resolves to unified_package URL without crashing.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", backend) - monkeypatch.setenv("SCT_SCYLLA_VERSION", scylla_version) - if backend == "gce": - monkeypatch.setenv( - "SCT_GCE_IMAGE_DB", - "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/family/centos-7", - ) - - fake_url = ( - "https://downloads.scylladb.com/unstable/scylla/master/relocatable/latest/" - "scylla-unified-6.3.0~dev-0.20260101.abcdef123456.x86_64.tar.gz" - ) - with ( - unittest.mock.patch("sdcm.sct_config.latest_unified_package", return_value=fake_url), - unittest.mock.patch( - "sdcm.sct_config.convert_name_to_ami_if_needed", - side_effect=lambda param, region_names: param, - ), - ): - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - assert conf.get("unified_package") == fake_url - assert conf.get("scylla_version") == "" - assert conf.get("use_preinstalled_scylla") is False - if expected_ami_ssm: - # On AWS, ami_id_db_scylla should be auto-set to the Ubuntu 24.04 SSM resolve pattern - assert conf.get("ami_id_db_scylla") == expected_ami_ssm - - -def test_unified_package_aws_auto_resolves_ami(monkeypatch): - """Test that unified_package on AWS auto-resolves ami_id_db_scylla to Ubuntu 24.04 base AMI when not set.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "aws") - monkeypatch.setenv( - "SCT_UNIFIED_PACKAGE", - ( - "https://downloads.scylladb.com/unstable/scylla/master/relocatable/2023-11-13T03:04:27Z/" - "scylla-unified-5.5.0~dev-0.20231113.7b08886e8dd8.x86_64.tar.gz" - ), - ) - - with unittest.mock.patch( - "sdcm.sct_config.convert_name_to_ami_if_needed", - side_effect=lambda param, region_names: param, - ): - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - assert conf.get("use_preinstalled_scylla") is False - assert conf.get("ami_db_scylla_user") == "ubuntu" - # ami_id_db_scylla should be auto-set to the Ubuntu 24.04 SSM resolve pattern - assert "resolve:ssm:" in conf.get("ami_id_db_scylla") - assert "ubuntu" in conf.get("ami_id_db_scylla") - - -def test_unified_package_aws_verify_passes_without_ami(monkeypatch): - """Test that verify_configuration passes with unified_package on AWS even if ami_id_db_scylla is not explicitly set.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "aws") - monkeypatch.setenv( - "SCT_UNIFIED_PACKAGE", - ( - "https://downloads.scylladb.com/unstable/scylla/master/relocatable/2023-11-13T03:04:27Z/" - "scylla-unified-5.5.0~dev-0.20231113.7b08886e8dd8.x86_64.tar.gz" - ), - ) - - # Mock convert_name_to_ami_if_needed to pass through the SSM pattern (simulates AMI resolution) - with unittest.mock.patch( - "sdcm.sct_config.convert_name_to_ami_if_needed", - side_effect=lambda param, region_names: param, - ): - conf = sct_config.SCTConfiguration() - # This should NOT raise AssertionError about ami_id_db_scylla, - # because unified_package is set and _check_version_supplied should not - # require backend-specific images when unified_package is provided - conf.verify_configuration() - - assert conf.get("use_preinstalled_scylla") is False - assert conf.get("unified_package") is not None - - def test_aws_ami_missing_scylla_version_tag(monkeypatch): """Test that missing scylla_version tag in AWS AMI raises clear ValueError.""" monkeypatch.setenv("SCT_CLUSTER_BACKEND", "aws") diff --git a/unit_tests/integration/test_sstable_load_utils.py b/unit_tests/integration/test_sstable_load_utils.py index c34e348c334..116bf34f995 100644 --- a/unit_tests/integration/test_sstable_load_utils.py +++ b/unit_tests/integration/test_sstable_load_utils.py @@ -33,7 +33,7 @@ def cleanup_thread(): cs_thread.run() - output, _ = cs_thread.parse_results() + output, _ = cs_thread.verify_results() column_num = SstableLoadUtils.calculate_columns_count_in_table( docker_scylla, keyspace_name="keyspace_refresh", table_name="standard1" diff --git a/unit_tests/test_alternator_streams_kcl.py b/unit_tests/test_alternator_streams_kcl.py index 851eb57e9e1..004c80dac5c 100644 --- a/unit_tests/test_alternator_streams_kcl.py +++ b/unit_tests/test_alternator_streams_kcl.py @@ -23,6 +23,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_cassandra_harry.py b/unit_tests/test_cassandra_harry.py index 343cc4c8c70..f4340906a0d 100644 --- a/unit_tests/test_cassandra_harry.py +++ b/unit_tests/test_cassandra_harry.py @@ -19,6 +19,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_cassandra_stress_thread.py b/unit_tests/test_cassandra_stress_thread.py index d1ece136281..6b833884f34 100644 --- a/unit_tests/test_cassandra_stress_thread.py +++ b/unit_tests/test_cassandra_stress_thread.py @@ -18,6 +18,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_cluster.py b/unit_tests/test_cluster.py index ed6ce5eee00..8632ef29ce2 100644 --- a/unit_tests/test_cluster.py +++ b/unit_tests/test_cluster.py @@ -840,6 +840,7 @@ def test_base_node_cpuset_not_configured(cat_results): @pytest.mark.integration +@pytest.mark.xdist_group("docker_heavy") def test_get_any_ks_cf_list(docker_scylla, params, events): cluster = DummyScyllaCluster([docker_scylla]) cluster.params = params @@ -983,6 +984,7 @@ def test_get_any_ks_cf_list(docker_scylla, params, events): @pytest.mark.integration +@pytest.mark.xdist_group("docker_heavy") def test_filter_out_ks_with_rf_one(docker_scylla, params, events): cluster = DummyScyllaCluster([docker_scylla]) cluster.params = params @@ -1007,6 +1009,7 @@ def test_filter_out_ks_with_rf_one(docker_scylla, params, events): @pytest.mark.integration +@pytest.mark.xdist_group("docker_heavy") def test_is_table_has_no_sstables(docker_scylla, params, events): """ test is_table_has_no_sstables filter function, as it would be used in `disrupt_snapshot_operations` nemesis @@ -1070,6 +1073,7 @@ def is_virtual_tables_get_snapshot(): @pytest.mark.integration +@pytest.mark.xdist_group("docker_heavy") def test_exclusive_connection(docker_scylla, docker_scylla_2, params, events): """ Test exclusive CQL connection creation for each node in the cluster. diff --git a/unit_tests/test_config.py b/unit_tests/test_config.py index 1da2dfb759f..d798f45214e 100644 --- a/unit_tests/test_config.py +++ b/unit_tests/test_config.py @@ -301,9 +301,13 @@ def test_12_k8s_scylla_version_ubuntu_loader_centos(monkeypatch): @pytest.mark.integration def test_13_scylla_version_ami_branch_latest(monkeypatch): + # resolve the branch from the current release instead of hardcoding one: AMIs for + # old branches age out of eu-west-1, which is how this test started failing on + # 'branch-5.2:latest'. + latest_branch = ".".join(_get_latest_scylla_release().split(".")[0:2]) monkeypatch.delenv("SCT_AMI_ID_DB_SCYLLA", raising=False) monkeypatch.setenv("SCT_CLUSTER_BACKEND", "aws") - monkeypatch.setenv("SCT_SCYLLA_VERSION", "branch-5.2:latest") + monkeypatch.setenv("SCT_SCYLLA_VERSION", f"branch-{latest_branch}:latest") monkeypatch.setenv("SCT_CONFIG_FILES", "internal_test_data/multi_region_dc_test_case.yaml") conf = sct_config.SCTConfiguration() conf.verify_configuration() diff --git a/unit_tests/test_config_get_version_based_on_conf.py b/unit_tests/test_config_get_version_based_on_conf.py deleted file mode 100644 index 7cca7685d3e..00000000000 --- a/unit_tests/test_config_get_version_based_on_conf.py +++ /dev/null @@ -1,205 +0,0 @@ -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation; either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# -# See LICENSE for more details. -# -# Copyright (c) 2023 ScyllaDB - -import logging -import unittest.mock -import pytest - -from sdcm import sct_config - -pytestmark = [ - pytest.mark.integration, -] - - -@pytest.fixture(scope="session", autouse=True) -def setup(): - logging.basicConfig(level=logging.ERROR) - logging.getLogger("botocore").setLevel(logging.CRITICAL) - logging.getLogger("boto3").setLevel(logging.CRITICAL) - logging.getLogger("anyconfig").setLevel(logging.ERROR) - - yield - - -@pytest.fixture(scope="function", autouse=True) -def function_setup(monkeypatch): - monkeypatch.setenv("SCT_CONFIG_FILES", "unit_tests/test_configs/minimal_test_case.yaml") - - -@pytest.mark.parametrize( - argnames="scylla_version, expected_docker_image, expected_outcome", - argvalues=[ - pytest.param("6.1", "scylladb/scylla", ("6.1", False), id="6.1"), - pytest.param("2024.1", "scylladb/scylla-enterprise", ("2024.1", True), id="2024.1"), - pytest.param("latest", "scylladb/scylla-nightly", (None, False), id="latest"), - pytest.param("master:latest", "scylladb/scylla-nightly", (None, False), id="master:latest"), - pytest.param("enterprise", "scylladb/scylla-enterprise-nightly", (None, True), id="enterprise"), - ], -) -def test_docker(scylla_version, expected_docker_image, expected_outcome, monkeypatch): - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "docker") - monkeypatch.setenv("SCT_USE_MGMT", "false") - monkeypatch.setenv("SCT_SCYLLA_VERSION", scylla_version) - - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - assert "docker_image" in conf.dump_config() - assert conf.get("docker_image") == expected_docker_image - _version, _is_enterprise = conf.get_version_based_on_conf() - if expected_outcome[0] is None: - assert _is_enterprise == expected_outcome[1] - else: - assert (_version, _is_enterprise) == expected_outcome - - -@pytest.mark.parametrize(argnames="distro", argvalues=("ubuntu-xenial", "centos", "debian-jessie")) -@pytest.mark.parametrize( - argnames="scylla_version, expected_outcome", - argvalues=[ - pytest.param("6.1", ("6.1", False), id="6.1"), - pytest.param("2024.1", ("2024.1", True), id="2024.1"), - pytest.param("master:latest", (None, True), id="master"), - pytest.param("branch-6.0:latest", (None, False), id="branch-6.0"), - pytest.param("enterprise-2023.1:latest", (None, True), id="enterprise-2023.1"), - pytest.param("enterprise-2024.1:latest", (None, True), id="enterprise-2024.1"), - ], -) -def test_scylla_repo(scylla_version, expected_outcome, distro, monkeypatch): - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "gce") - monkeypatch.setenv("SCT_SCYLLA_VERSION", scylla_version) - monkeypatch.setenv( - "SCT_GCE_IMAGE_DB", "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/family/centos-7" - ) - monkeypatch.setenv("SCT_USE_PREINSTALLED_SCYLLA", "false") - monkeypatch.setenv("SCT_SCYLLA_LINUX_DISTRO", distro) - - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - _version, _is_enterprise = conf.get_version_based_on_conf() - - if expected_outcome[0] is not None: - assert expected_outcome[0] in _version - assert _is_enterprise == expected_outcome[1] - - -@pytest.mark.parametrize( - argnames="scylla_version, expected_outcome", - argvalues=[ - pytest.param("6.2", ("6.2", False), id="6.2"), - pytest.param("2024.2", ("2024.2", True), id="2024.2"), - pytest.param("master:latest", (None, True), id="master"), - pytest.param("branch-6.2:latest", (None, False), id="branch-6.2"), - pytest.param("branch-2024.1:latest", (None, True), id="branch-2024.1"), - pytest.param("branch-2024.2:latest", (None, True), id="branch-2024.2"), - ], -) -@pytest.mark.parametrize(argnames="backend", argvalues=("aws", "gce", "azure")) -def test_images(backend, scylla_version, expected_outcome, monkeypatch): - monkeypatch.setenv("SCT_CLUSTER_BACKEND", backend) - monkeypatch.setenv("SCT_SCYLLA_VERSION", scylla_version) - - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - _version, _is_enterprise = conf.get_version_based_on_conf() - - if expected_outcome[0] is not None: - assert expected_outcome[0] in _version - assert _is_enterprise == expected_outcome[1] - - -def test_baremetal(monkeypatch): - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "baremetal") - monkeypatch.setenv("SCT_SCYLLA_VERSION", "6.1") - monkeypatch.setenv("SCT_S3_BAREMETAL_CONFIG", "some_config") - monkeypatch.setenv("SCT_DB_NODES_PRIVATE_IP", '["127.0.0.1"]') - monkeypatch.setenv("SCT_DB_NODES_PUBLIC_IP", '["127.0.0.1"]') - - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - _version, _is_enterprise = conf.get_version_based_on_conf() - - assert "6.1" in _version - assert not _is_enterprise - - -def test_unified_package(monkeypatch): - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "gce") - monkeypatch.setenv( - "SCT_UNIFIED_PACKAGE", - ( - "https://downloads.scylladb.com/unstable/scylla/master/relocatable/2023-11-13T03:04:27Z/" - "scylla-unified-5.5.0~dev-0.20231113.7b08886e8dd8.x86_64.tar.gz" - ), - ) - monkeypatch.setenv( - "SCT_GCE_IMAGE_DB", "https://www.googleapis.com/compute/v1/projects/centos-cloud/global/images/family/centos-7" - ) - - monkeypatch.setenv("SCT_USE_PREINSTALLED_SCYLLA", "false") - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - _version, _is_enterprise = conf.get_version_based_on_conf() - - assert "5.5.0" in _version - assert not _is_enterprise - - -def test_aws_ami_missing_scylla_version_tag(monkeypatch): - """Test that missing scylla_version tag in AWS AMI raises clear ValueError.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "aws") - monkeypatch.setenv("SCT_AMI_ID_DB_SCYLLA", "ami-notags") - - # Mock get_ami_tags to return empty dict (AMI exists but has no tags) - with unittest.mock.patch("sdcm.sct_config.get_ami_tags", return_value={}): - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - with pytest.raises( - ValueError, match=r"AMI 'ami-notags' .* does not have 'scylla_version' or 'ScyllaVersion' tag" - ): - conf.get_version_based_on_conf() - - -def test_gce_image_missing_scylla_version_tag(monkeypatch): - """Test that missing scylla_version tag in GCE image raises clear ValueError.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "gce") - monkeypatch.setenv("SCT_GCE_IMAGE_DB", "projects/test/global/images/scylla-test") - - # Mock get_gce_image_tags to return empty dict - with unittest.mock.patch("sdcm.sct_config.get_gce_image_tags", return_value={}): - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - with pytest.raises(ValueError, match=r"GCE image .* does not have 'scylla_version' tag"): - conf.get_version_based_on_conf() - - -def test_azure_image_missing_scylla_version_tag(monkeypatch): - """Test that missing scylla_version tag in Azure image raises clear ValueError.""" - monkeypatch.setenv("SCT_CLUSTER_BACKEND", "azure") - monkeypatch.setenv( - "SCT_AZURE_IMAGE_DB", - "/subscriptions/test/resourceGroups/test/providers/Microsoft.Compute/images/scylla-test", - ) - - # Mock get_image_tags to return empty dict - with unittest.mock.patch("sdcm.sct_config.azure_utils.get_image_tags", return_value={}): - conf = sct_config.SCTConfiguration() - conf.verify_configuration() - - with pytest.raises(ValueError, match=r"Azure image .* does not have 'scylla_version' tag"): - conf.get_version_based_on_conf() diff --git a/unit_tests/test_cql_stress_cassandra_stress_thread.py b/unit_tests/test_cql_stress_cassandra_stress_thread.py index 6a782abfb5e..19e91a3a0ce 100644 --- a/unit_tests/test_cql_stress_cassandra_stress_thread.py +++ b/unit_tests/test_cql_stress_cassandra_stress_thread.py @@ -23,6 +23,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_kafka.py b/unit_tests/test_kafka.py index 209227958fc..915e66362ae 100644 --- a/unit_tests/test_kafka.py +++ b/unit_tests/test_kafka.py @@ -23,6 +23,7 @@ pytestmark = [ pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] LOGGER = logging.getLogger(__name__) diff --git a/unit_tests/test_latte_thread.py b/unit_tests/test_latte_thread.py index fb18cbff94e..07cbdb2dd4f 100644 --- a/unit_tests/test_latte_thread.py +++ b/unit_tests/test_latte_thread.py @@ -27,6 +27,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_microbenchmarking.py b/unit_tests/test_microbenchmarking.py deleted file mode 100644 index f47a5365ae9..00000000000 --- a/unit_tests/test_microbenchmarking.py +++ /dev/null @@ -1,313 +0,0 @@ -from __future__ import absolute_import -import unittest -import os.path -import subprocess -import logging -import pickle -import tempfile -import json -import zipfile -import hashlib - -from sdcm.microbenchmarking import MicroBenchmarkingResultsAnalyzer, LargeNumberOfDatasetsException, EmptyResultFolder - - -LOGGER = logging.getLogger("microbenchmarking-tests") - - -class MicroBenchmarkingResultsAnalyzerMock(MicroBenchmarkingResultsAnalyzer): - _mock_returns = None - _mock_returns_path = os.path.join( - os.path.dirname(__file__), "test_data/test_microbenchmarking/mock_response/{funct_name}/{hash}.zip" - ) - - def _send_report(self, subject, summary_html, files): - return files[0], summary_html - - def _get_prior_tests(self, filter_path, additional_filter=""): - return self._mock_function("_get_prior_tests", filter_path, additional_filter) - - def _mock_function(self, target_fn, *args, **kwargs): - output = self._load_mock_return("_get_prior_tests", args=args, kwargs=kwargs) - if output is None: - tmp = super() - output = getattr(tmp, target_fn)(*args, **kwargs) - file_path = self._save_mock_return("_get_prior_tests", args=args, kwargs=kwargs, result=output) - raise RuntimeError(f"There is no mock response {file_path} for this call ") - return output - - def _load_mock_return(self, target_fn, args=None, kwargs=None): - params_hash = self._get_hash(args, kwargs) - source_file_full_path = self._mock_returns_path.format(funct_name=target_fn, hash=params_hash) - if not os.path.exists(source_file_full_path): - return None - with zipfile.ZipFile(source_file_full_path, "r") as zip_ref: - return json.load(zip_ref.open("return.json")) - - def _save_mock_return(self, target_fn, args=None, kwargs=None, result=None): - params_hash = self._get_hash(args, kwargs) - source_file_full_path = self._mock_returns_path.format(funct_name=target_fn, hash=params_hash) - with zipfile.ZipFile(source_file_full_path, "w", compression=zipfile.ZIP_DEFLATED) as zip_ref: - zip_ref.writestr("return.json", json.dumps(result).encode()) - return source_file_full_path - - @staticmethod - def _get_hash(*args, **kwargs): - kwargs = sorted(kwargs.items(), key=lambda x: x[0]) - params_hash = hashlib.md5(repr({"args": args, "kwarg": kwargs}).encode()).hexdigest() - return params_hash - - -class TestMBM(unittest.TestCase): - def setUp(self): - self.mbra = MicroBenchmarkingResultsAnalyzerMock( - email_recipients=("alex.bykov@scylladb.com",), es_index="microbenchmarking" - ) - self.mbra.hostname = "monster" - self.cwd = os.path.join(os.path.dirname(__file__), "..", "sdcm") - self.mbra.test_run_date = "2019-06-27_11:39:40" - self.es_index = "microbenchmarkingv3" - - @staticmethod - def get_result_obj(path): - with open(os.path.join(path, "result_obj"), "rb") as result_file: - expected_obj = pickle.load(result_file, encoding="latin-1") - return expected_obj - - @staticmethod - def get_report_obj(path): - with open(os.path.join(path, "report_obj"), "rb") as result_file: - expected_obj = pickle.load(result_file, encoding="latin-1") - return expected_obj - - def test_object_exists(self): - self.assertIsInstance(self.mbra, MicroBenchmarkingResultsAnalyzer) - self.assertEqual(self.mbra.hostname, "monster") - self.assertEqual(self.mbra._email_recipients, ("alex.bykov@scylladb.com",)) - - def test_get_result_with_avg_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_AVGAIO") - results = self.mbra.get_results(results_path=result_path, update_db=False) - self.assertTrue(results) - expected_obj = self.get_result_obj(result_path) - assert results == expected_obj - - def test_get_result_without_avg_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_without_AVGAIO") - results = self.mbra.get_results(results_path=result_path, update_db=False) - self.assertTrue(results) - expected_obj = self.get_result_obj(result_path) - self.assertDictEqual(results, expected_obj) - - def test_get_result_with_new_metrics_avg_cpu(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_new_metric") - results = self.mbra.get_results(results_path=result_path, update_db=False) - self.assertTrue(results) - expected_obj = self.get_result_obj(result_path) - self.assertDictEqual(results, expected_obj) - - def test_get_result_with_2_datasets(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_2_datasets") - self.assertRaises( - LargeNumberOfDatasetsException, self.mbra.get_results, results_path=result_path, update_db=False - ) - - def test_get_result_for_empty_base_folder(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_empty_folder") - self.assertRaises(EmptyResultFolder, self.mbra.get_results, results_path=result_path, update_db=False) - - def test_get_result_for_empty_tests_folders(self): - result_path = os.path.join( - os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_empty_tests_folders" - ) - self.assertRaises(EmptyResultFolder, self.mbra.get_results, results_path=result_path, update_db=False) - - def test_get_result_for_empty_dataset_folders(self): - result_path = os.path.join( - os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_empty_dataset_folders" - ) - self.assertRaises(EmptyResultFolder, self.mbra.get_results, results_path=result_path, update_db=False) - - def test_check_regression_for_results_with_avg_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_AVGAIO") - result_obj = self.get_result_obj(result_path) - self.mbra.cur_version_info = result_obj[list(result_obj.keys())[0]]["versions"]["scylla-server"] - report_results = self.mbra.check_regression(result_obj) - self.assertTrue(report_results) - - def test_check_regression_for_results_without_avg_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_without_AVGAIO") - result_obj = self.get_result_obj(result_path) - # self.mbra.load_mock_return('_get_prior_tests', 'PFF_without_AVGAIO/_get_prior_tests.zip') - self.mbra.cur_version_info = result_obj[list(result_obj.keys())[0]]["versions"]["scylla-server"] - report_results = self.mbra.check_regression(result_obj) - self.assertTrue(report_results) - - def test_check_regression_for_results_with_new_metrics_cpu_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_new_metric") - result_obj = self.get_result_obj(result_path) - self.mbra.cur_version_info = result_obj[list(result_obj.keys())[0]]["versions"]["scylla-server"] - report_results = self.mbra.check_regression(result_obj) - self.assertTrue(report_results) - - def test_check_regression_for_new_metrics_cpu_aio_and_empty_last_and_best(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_new_metric") - result_obj = self.get_result_obj(result_path) - self.mbra.cur_version_info = result_obj[list(result_obj.keys())[0]]["versions"]["scylla-server"] - self.mbra.lower_better = ("avg cpu",) - self.mbra.metrics = self.mbra.higher_better + self.mbra.lower_better - report_results = self.mbra.check_regression(result_obj) - - self.assertTrue(report_results) - self.assertEqual(report_results["small-partition-slicing_0-1.1"]["avg cpu"]["Current"], 26.0) - self.assertEqual(report_results["small-partition-slicing_0-1.1"]["avg cpu"]["Last, commit, date"][0], None) - self.assertEqual(report_results["small-partition-slicing_0-1.1"]["avg cpu"]["Best, commit, date"][0], None) - self.assertEqual(report_results["large-partition-forwarding_no.1"]["avg cpu"]["Current"], 58.0) - self.assertEqual(report_results["large-partition-forwarding_no.1"]["avg cpu"]["Last, commit, date"][0], None) - self.assertEqual(report_results["large-partition-forwarding_no.1"]["avg cpu"]["Best, commit, date"][0], None) - self.assertEqual(report_results["large-partition-forwarding_yes.1"]["avg cpu"]["Current"], 62.0) - self.assertEqual(report_results["large-partition-forwarding_yes.1"]["avg cpu"]["Last, commit, date"][0], None) - self.assertEqual(report_results["large-partition-forwarding_yes.1"]["avg cpu"]["Best, commit, date"][0], None) - self.assertEqual(report_results["small-partition-slicing_500000-4096.1"]["avg cpu"]["Current"], 97.0) - self.assertEqual( - report_results["small-partition-slicing_500000-4096.1"]["avg cpu"]["Last, commit, date"][0], None - ) - self.assertEqual( - report_results["small-partition-slicing_500000-4096.1"]["avg cpu"]["Best, commit, date"][0], None - ) - - def test_generate_html_report_file_and_email_body_for_results_with_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_AVGAIO") - report_obj = self.get_report_obj(result_path) - html_report = tempfile.mkstemp(suffix=".html", prefix="microbenchmarking-")[1] - report_file, report_html = self.mbra.send_html_report(report_obj, html_report_path=html_report) - - self.assertTrue(os.path.exists(report_file)) - self.assertGreater(os.path.getsize(report_file), 0) - self.assertTrue(report_html) - self.assertIn("large-partition-forwarding", report_html) - self.assertIn("small-partition-slicing", report_html) - - def verify_html_report_correctness(self, report_results): - html_report = tempfile.mkstemp(suffix=".html", prefix="microbenchmarking-")[1] - report_file, report_html = self.mbra.send_html_report(report_results, html_report_path=html_report) - - self.assertTrue(os.path.exists(report_file)) - self.assertGreater(os.path.getsize(report_file), 0) - self.assertTrue(report_html) - for key in report_results.keys(): - if report_results[key].get("has_diff", False) or report_results[key].get("has_improve", False): - self.assertIn(key, report_results) - self.assertIn("Kibana dashboard", report_html) - - def test_generate_html_report_file_and_email_body_for_results_without_aio(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_without_AVGAIO") - report_obj = self.get_report_obj(result_path) - - self.verify_html_report_correctness(report_obj) - - def test_generate_html_report_for_avg_aio_with_zero_value(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_AVGAIO_0") - result_obj = self.mbra.get_results(results_path=result_path, update_db=False) - self.mbra.cur_version_info = result_obj[list(result_obj.keys())[0]]["versions"]["scylla-server"] - report_results = self.mbra.check_regression(result_obj) - - self.assertEqual(report_results["small-partition-slicing_0-256.1"]["avg aio"]["Current"], 0.0) - self.assertEqual(report_results["small-partition-slicing_0-256.1"]["avg aio"]["Diff best [%]"], None) - self.assertEqual(report_results["small-partition-slicing_0-256.1"]["avg aio"]["Diff last [%]"], None) - self.assertEqual(report_results["large-partition-forwarding_no.1"]["avg aio"]["Current"], 0.0) - self.assertEqual(report_results["large-partition-forwarding_no.1"]["avg aio"]["Diff best [%]"], None) - self.assertEqual(report_results["large-partition-forwarding_no.1"]["avg aio"]["Diff last [%]"], None) - self.assertEqual(report_results["large-partition-forwarding_yes.1"]["avg aio"]["Current"], 0.0) - self.assertEqual(report_results["large-partition-forwarding_yes.1"]["avg aio"]["Diff best [%]"], None) - self.assertEqual(report_results["large-partition-forwarding_yes.1"]["avg aio"]["Diff last [%]"], None) - self.assertEqual(report_results["small-partition-slicing_500000-4096.1"]["avg aio"]["Current"], 0.0) - self.assertEqual(report_results["small-partition-slicing_500000-4096.1"]["avg aio"]["Diff best [%]"], None) - self.assertEqual(report_results["small-partition-slicing_500000-4096.1"]["avg aio"]["Diff last [%]"], None) - - self.verify_html_report_correctness(report_results) - - def test_empty_current_result(self): - result_obj = {} - report_results = self.mbra.check_regression(result_obj) - self.assertFalse(report_results) - - def test_main_help_message(self): - env = os.environ.copy() - env["PYTHONWARNINGS"] = "ignore::FutureWarning:google.api_core._python_version_support" - with subprocess.Popen( - ["./microbenchmarking.py", "--help"], cwd=self.cwd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env - ) as ps: - stdout, stderr = ps.communicate() - self.assertEqual(ps.returncode, 0) - self.assertIn(b"usage: microbenchmarking.py [-h] Modes ...", stdout) - self.assertFalse(stderr) - - def test_help_parameter_for_exclude(self): - msg = b"usage: microbenchmarking.py exclude [-h]" - env = os.environ.copy() - env["PYTHONWARNINGS"] = "ignore::FutureWarning:google.api_core._python_version_support" - with subprocess.Popen( - ["./microbenchmarking.py", "exclude", "--help"], - cwd=self.cwd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env=env, - ) as ps: - stdout, stderr = ps.communicate() - self.assertEqual(ps.returncode, 0) - self.assertIn(msg, stdout) - self.assertFalse(stderr) - - def test_help_parameter_for_check(self): - msg = b"""usage: microbenchmarking.py check [-h] [--update-db]""" - env = os.environ.copy() - env["PYTHONWARNINGS"] = "ignore::FutureWarning:google.api_core._python_version_support" - with subprocess.Popen( - ["./microbenchmarking.py", "check", "--help"], - cwd=self.cwd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env=env, - ) as ps: - stdout, stderr = ps.communicate() - self.assertEqual(ps.returncode, 0) - self.assertIn(msg, stdout) - self.assertFalse(stderr) - - def test_execute_mbm_from_cli(self): - result_path = os.path.join(os.path.dirname(__file__), "test_data/test_microbenchmarking/PFF_with_AVGAIO") - html_report = tempfile.mkstemp(suffix=".html", prefix="microbenchmarking-")[1] - env = os.environ.copy() - env["PYTHONWARNINGS"] = "ignore::FutureWarning:google.api_core._python_version_support" - with subprocess.Popen( - [ - "./microbenchmarking.py", - "check", - "--results-path", - result_path, - "--email-recipients", - "alex.bykov@scylladb.com", - "--report-path", - html_report, - "--hostname", - self.mbra.hostname, - "--es-index", - self.es_index, - ], - cwd=self.cwd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - env=env, - ) as ps: - stdout, _ = ps.communicate() - print(_) - print(stdout) - self.assertEqual(ps.returncode, 0) - self.assertIn(b"Send email to ['alex.bykov@scylladb.com']", stdout) - self.assertIn(b"HTML report saved to '/tmp/microbenchmarking", stdout) - self.assertIn(b"Rendering results to html using 'results_microbenchmark.html' template...", stdout) - - -if __name__ == "__main__": - unittest.main(verbosity=2) diff --git a/unit_tests/test_ndbench_thread.py b/unit_tests/test_ndbench_thread.py index 72334817318..ce32b557fdd 100644 --- a/unit_tests/test_ndbench_thread.py +++ b/unit_tests/test_ndbench_thread.py @@ -8,6 +8,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_python_driver.py b/unit_tests/test_python_driver.py index 22e6fa8ca48..2130bf7e1b8 100644 --- a/unit_tests/test_python_driver.py +++ b/unit_tests/test_python_driver.py @@ -4,6 +4,9 @@ from unit_tests.test_cluster import DummyDbCluster +pytestmark = [ + pytest.mark.xdist_group("docker_heavy"), +] log = logging.getLogger(__name__) diff --git a/unit_tests/test_run_cqlsh.py b/unit_tests/test_run_cqlsh.py index 32ddfad9f1a..d1f921dfcbc 100644 --- a/unit_tests/test_run_cqlsh.py +++ b/unit_tests/test_run_cqlsh.py @@ -15,6 +15,7 @@ pytestmark = [ pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_scylla_bench_thread.py b/unit_tests/test_scylla_bench_thread.py index b6a5f8eee10..0904c866c89 100644 --- a/unit_tests/test_scylla_bench_thread.py +++ b/unit_tests/test_scylla_bench_thread.py @@ -20,6 +20,7 @@ pytest.mark.usefixtures( "events", ), + pytest.mark.xdist_group("docker_heavy"), ] diff --git a/unit_tests/test_utils_database_query_utils.py b/unit_tests/test_utils_database_query_utils.py index 8a70f3631df..f72fc37fdd3 100644 --- a/unit_tests/test_utils_database_query_utils.py +++ b/unit_tests/test_utils_database_query_utils.py @@ -5,6 +5,7 @@ @pytest.mark.integration +@pytest.mark.xdist_group("docker_heavy") def test_fetch_all_rows(docker_scylla, params, events): cluster = DummyScyllaCluster([docker_scylla]) cluster.params = params diff --git a/unit_tests/test_ycsb_thread.py b/unit_tests/test_ycsb_thread.py index 26572e11495..a132cbdf9f9 100644 --- a/unit_tests/test_ycsb_thread.py +++ b/unit_tests/test_ycsb_thread.py @@ -28,6 +28,7 @@ pytestmark = [ pytest.mark.usefixtures("events"), pytest.mark.integration, + pytest.mark.xdist_group("docker_heavy"), ]