From df4ec18768445a559077d9b7674fad2cfc605b63 Mon Sep 17 00:00:00 2001 From: vuong-nguyen <44292934+nkvuong@users.noreply.github.com> Date: Tue, 27 Feb 2024 00:38:42 +0000 Subject: [PATCH] Fix integration tests on AWS (#978) --- tests/integration/framework/test_crawlers.py | 5 +++-- tests/integration/test_installation.py | 10 +++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/integration/framework/test_crawlers.py b/tests/integration/framework/test_crawlers.py index 1270772e39..2eccedc80a 100644 --- a/tests/integration/framework/test_crawlers.py +++ b/tests/integration/framework/test_crawlers.py @@ -142,8 +142,9 @@ def test_runtime_backend_permission_denied_handled(ws, wsfs_wheel): assert permission_denied_fetch == "PASSED" -def test_runtime_backend_unknown_error_handled(ws, wsfs_wheel): - commands = CommandExecutor(ws.clusters, ws.command_execution, lambda: ws.config.cluster_id) +def test_runtime_backend_unknown_error_handled(ws, env_or_skip, wsfs_wheel): + """We test this on the default cluster, i.e. without UC enabled. The command will throw an unknown error""" + commands = CommandExecutor(ws.clusters, ws.command_execution, lambda: env_or_skip("TEST_DEFAULT_CLUSTER_ID")) commands.install_notebook_library(f"/Workspace{wsfs_wheel}") diff --git a/tests/integration/test_installation.py b/tests/integration/test_installation.py index ddc9539856..0148099056 100644 --- a/tests/integration/test_installation.py +++ b/tests/integration/test_installation.py @@ -124,9 +124,13 @@ def test_job_cluster_policy(ws, new_installation): assert policy_definition["spark_version"]["value"] == ws.clusters.select_spark_version(latest=True) assert policy_definition["node_type_id"]["value"] == ws.clusters.select_node_type(local_disk=True) - assert ( - policy_definition["azure_attributes.availability"]["value"] == compute.AzureAvailability.ON_DEMAND_AZURE.value - ) + if ws.config.is_azure: + assert ( + policy_definition["azure_attributes.availability"]["value"] + == compute.AzureAvailability.ON_DEMAND_AZURE.value + ) + if ws.config.is_aws: + assert policy_definition["aws_attributes.availability"]["value"] == compute.AwsAvailability.ON_DEMAND.value @pytest.mark.skip