From aaf593d17f51a517e0adb6e9ec1c0d768ab5f855 Mon Sep 17 00:00:00 2001 From: Victor Zhestkov Date: Mon, 2 Oct 2023 14:24:27 +0200 Subject: [PATCH] Fix optimization_order opt to prevent test fails --- tests/pytests/unit/grains/test_core.py | 4 ++-- tests/pytests/unit/loader/test_loader.py | 2 +- tests/pytests/unit/test_config.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pytests/unit/grains/test_core.py b/tests/pytests/unit/grains/test_core.py index 993c723950..36545287b9 100644 --- a/tests/pytests/unit/grains/test_core.py +++ b/tests/pytests/unit/grains/test_core.py @@ -156,7 +156,7 @@ def test_network_grains_secondary_ip(tmp_path): opts = { "cachedir": str(cache_dir), "extension_modules": str(extmods), - "optimization_order": [0], + "optimization_order": [0, 1, 2], } with patch("salt.utils.network.interfaces", side_effect=[data]): grains = salt.loader.grain_funcs(opts) @@ -243,7 +243,7 @@ def test_network_grains_cache(tmp_path): opts = { "cachedir": str(cache_dir), "extension_modules": str(extmods), - "optimization_order": [0], + "optimization_order": [0, 1, 2], } with patch( "salt.utils.network.interfaces", side_effect=[call_1, call_2] diff --git a/tests/pytests/unit/loader/test_loader.py b/tests/pytests/unit/loader/test_loader.py index f4a4b51a58..86348749db 100644 --- a/tests/pytests/unit/loader/test_loader.py +++ b/tests/pytests/unit/loader/test_loader.py @@ -57,7 +57,7 @@ def test_raw_mod_functions(): "Ensure functions loaded by raw_mod are LoaderFunc instances" opts = { "extension_modules": "", - "optimization_order": [0], + "optimization_order": [0, 1, 2], } ret = salt.loader.raw_mod(opts, "grains", "get") for k, v in ret.items(): diff --git a/tests/pytests/unit/test_config.py b/tests/pytests/unit/test_config.py index cb343cb75e..76d5605360 100644 --- a/tests/pytests/unit/test_config.py +++ b/tests/pytests/unit/test_config.py @@ -16,7 +16,7 @@ def test_call_id_function(tmp_path): "cachedir": str(cache_dir), "extension_modules": str(extmods), "grains": {"osfinger": "meh"}, - "optimization_order": [0], + "optimization_order": [0, 1, 2], } ret = salt.config.call_id_function(opts) assert ret == "meh" -- 2.42.0