From 574a0454c9cf9cb54e0613060179a2a541afc6c2 Mon Sep 17 00:00:00 2001 From: Alejandro R Mosteo Date: Wed, 20 Mar 2024 16:57:36 +0100 Subject: [PATCH] Testsuite control condition for Unix-only (#1657) * Test control condition for Unix-only * Fix test post-merge --- testsuite/drivers/driver/base_driver.py | 1 + testsuite/skels/global-index/test.yaml | 1 + testsuite/skels/local-index/test.yaml | 1 + testsuite/skels/no-index/test.yaml | 2 ++ testsuite/tests/install/softlinks/test.py | 5 +---- testsuite/tests/install/softlinks/test.yaml | 2 ++ 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/testsuite/drivers/driver/base_driver.py b/testsuite/drivers/driver/base_driver.py index 209252ceb..e87c15f38 100644 --- a/testsuite/drivers/driver/base_driver.py +++ b/testsuite/drivers/driver/base_driver.py @@ -47,6 +47,7 @@ def __init__(self, env: e3.env.Env, test_env: Dict[str, Any]): # Hardcode OSes for osname in ["windows", "linux", "macos"]: self.skip[f"skip_{osname}"] = not getattr(drivers.helpers, f"on_{osname}")() + self.skip[f"skip_unix"] = drivers.helpers.on_windows() @property def test_control_creator(self): diff --git a/testsuite/skels/global-index/test.yaml b/testsuite/skels/global-index/test.yaml index 1a71b1b05..dbc089b83 100644 --- a/testsuite/skels/global-index/test.yaml +++ b/testsuite/skels/global-index/test.yaml @@ -1,5 +1,6 @@ driver: python-script build_mode: both # one of shared, sandboxed, both (default) +control: # Used to disable test depending on one of: (see no-skel/test.yaml) indexes: basic_index: in_fixtures: true diff --git a/testsuite/skels/local-index/test.yaml b/testsuite/skels/local-index/test.yaml index a0ce9ba5e..f791268e6 100644 --- a/testsuite/skels/local-index/test.yaml +++ b/testsuite/skels/local-index/test.yaml @@ -1,5 +1,6 @@ driver: python-script build_mode: both # one of shared, sandboxed, both (default) +control: # Used to disable test depending on one of: (see no-skel/test.yaml) indexes: my_index: in_fixtures: false diff --git a/testsuite/skels/no-index/test.yaml b/testsuite/skels/no-index/test.yaml index 97d4f3d5c..317e4f5a1 100644 --- a/testsuite/skels/no-index/test.yaml +++ b/testsuite/skels/no-index/test.yaml @@ -7,7 +7,9 @@ control: # Used to disable test depending on one of: - [SKIP, "skip_network", "Network-requiring tests disabled"] - [SKIP, "skip_linux", "Test is Linux-only"] - [SKIP, "skip_macos", "Test is macOS-only"] + - [SKIP, "skip_unix", "Test is Unix-only"] - [SKIP, "skip_windows", "Test is Windows-only"] + # These have to be interpreted as: "skip (if not running under) condition" indexes: compiler_only_index: {} # Note that shared builds require a detected compiler to be able to compute diff --git a/testsuite/tests/install/softlinks/test.py b/testsuite/tests/install/softlinks/test.py index 54a23b002..a0f881d6f 100644 --- a/testsuite/tests/install/softlinks/test.py +++ b/testsuite/tests/install/softlinks/test.py @@ -30,10 +30,7 @@ import os import shutil -import subprocess -import sys - -from drivers.alr import crate_dirname, run_alr +from drivers.alr import run_alr, crate_dirname from drivers.helpers import contents, on_windows diff --git a/testsuite/tests/install/softlinks/test.yaml b/testsuite/tests/install/softlinks/test.yaml index 0a859639c..1f89021f2 100644 --- a/testsuite/tests/install/softlinks/test.yaml +++ b/testsuite/tests/install/softlinks/test.yaml @@ -1,4 +1,6 @@ driver: python-script +control: + - [SKIP, "skip_unix", "Test is Unix-only"] indexes: my_index: in_fixtures: false