From eb3bd99e10baff99777b17937f1c14425ba28440 Mon Sep 17 00:00:00 2001 From: Hanwen Date: Tue, 29 Oct 2024 11:28:01 -0700 Subject: [PATCH] [integ-tests] Remove test_create_wrong_pcluster_version This test is intentionally using a custom AMI with the wrong ParallelCluster version and expecting error messages in cloud-init-output.log. This test is not stable because as soon as we make major cookbook changes, the error messages might not appear. This integration test was created by me. It really seems superfluous. Signed-off-by: Hanwen --- tests/integration-tests/configs/develop.yaml | 6 --- .../configs/isolated_regions.yaml | 6 --- tests/integration-tests/configs/released.yaml | 6 --- .../tests/create/test_create.py | 37 +------------------ 4 files changed, 1 insertion(+), 54 deletions(-) diff --git a/tests/integration-tests/configs/develop.yaml b/tests/integration-tests/configs/develop.yaml index c3e4f6d3fb..c96f92bdc4 100644 --- a/tests/integration-tests/configs/develop.yaml +++ b/tests/integration-tests/configs/develop.yaml @@ -112,12 +112,6 @@ test-suites: instances: {{ common.INSTANCES_DEFAULT_X86 }} oss: ["rhel8"] # os must be different from ubuntu2004 to test os validation logic when wrong os is provided schedulers: ["slurm"] - test_create.py::test_create_wrong_pcluster_version: - dimensions: - - regions: ["ca-central-1"] - instances: {{ common.INSTANCES_DEFAULT_X86 }} - oss: ["alinux2"] - schedulers: ["slurm"] test_create.py::test_create_imds_secured: dimensions: - regions: ["eu-south-1"] diff --git a/tests/integration-tests/configs/isolated_regions.yaml b/tests/integration-tests/configs/isolated_regions.yaml index c7222148f5..e00123d275 100644 --- a/tests/integration-tests/configs/isolated_regions.yaml +++ b/tests/integration-tests/configs/isolated_regions.yaml @@ -101,12 +101,6 @@ test-suites: # - regions: {{ REGIONS }} # instances: {{ INSTANCES }} # oss: {{ OSS }} -# schedulers: {{ SCHEDULERS }} -# test_create.py::test_create_wrong_pcluster_version: -# dimensions: -# - regions: {{ REGIONS }} -# instances: {{ INSTANCES }} -# oss: {{ OSS }} # schedulers: {{ SCHEDULERS }} test_create.py::test_create_imds_secured: dimensions: diff --git a/tests/integration-tests/configs/released.yaml b/tests/integration-tests/configs/released.yaml index b479dbb5a9..c3ffbc06e1 100644 --- a/tests/integration-tests/configs/released.yaml +++ b/tests/integration-tests/configs/released.yaml @@ -60,12 +60,6 @@ test-suites: instances: {{ common.INSTANCES_DEFAULT_X86 }} oss: ["rhel8"] # os must be different from ubuntu2004 to test os validation logic when wrong os is provided schedulers: ["slurm"] - test_create.py::test_create_wrong_pcluster_version: - dimensions: - - regions: ["ca-central-1"] - instances: {{ common.INSTANCES_DEFAULT_X86 }} - oss: ["alinux2"] - schedulers: ["slurm"] test_create.py::test_create_imds_secured: dimensions: - regions: ["eu-south-1"] diff --git a/tests/integration-tests/tests/create/test_create.py b/tests/integration-tests/tests/create/test_create.py index 64f48173e6..8975fd0ff9 100644 --- a/tests/integration-tests/tests/create/test_create.py +++ b/tests/integration-tests/tests/create/test_create.py @@ -26,7 +26,7 @@ assert_head_node_is_running, assert_lines_in_logs, ) -from tests.common.utils import get_installed_parallelcluster_version, reboot_head_node, retrieve_latest_ami +from tests.common.utils import reboot_head_node, retrieve_latest_ami @pytest.mark.usefixtures("instance", "scheduler") @@ -52,41 +52,6 @@ def test_create_wrong_os(region, os, pcluster_config_reader, clusters_factory, a ) -@pytest.mark.usefixtures("instance", "os", "scheduler") -def test_create_wrong_pcluster_version( - region, pcluster_config_reader, pcluster_ami_without_standard_naming, clusters_factory -): - """Test error message when AMI provided was baked by a pcluster whose version is different from current version""" - current_version = get_installed_parallelcluster_version() - wrong_version = "3.10.0" - logging.info("Asserting wrong_version is different from current_version") - assert_that(current_version != wrong_version).is_true() - # Retrieve an AMI without 'aws-parallelcluster-' in its name. - # Therefore, we can bypass the version check in CLI and test version check of .bootstrapped file in Cookbook. - wrong_ami = pcluster_ami_without_standard_naming(wrong_version) - cluster_config = pcluster_config_reader(custom_ami=wrong_ami) - cluster = clusters_factory(cluster_config, raise_on_error=False) - - assert_head_node_is_running(region, cluster) - remote_command_executor = RemoteCommandExecutor(cluster) - - logging.info("Verifying error in logs") - assert_lines_in_logs( - remote_command_executor, - ["/var/log/cloud-init-output.log"], - ["error_exit", rf"AMI was created.+{wrong_version}.+is.+used.+{current_version}"], - ) - logging.info("Verifying failures in describe-clusters output") - expected_failures = [ - { - "failureCode": "AmiVersionMismatch", - "failureReason": "ParallelCluster version of the custom AMI is different than the cookbook. Please make " - "them consistent.", - } - ] - assert_that(cluster.creation_response.get("failures")).is_equal_to(expected_failures) - - @pytest.mark.usefixtures("instance", "scheduler") @pytest.mark.parametrize( "imds_secured, users_allow_list",