From 75b8272a3ce0f0e3b5e555d252610b6781d9ec80 Mon Sep 17 00:00:00 2001 From: Ara Ghukasyan <38226926+araghukas@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:46:56 -0500 Subject: [PATCH] Patch executor manager to ignore extra plugins discovered during CI tests (#1870) * patch executor manager to ignore extra plugins * update changelog --- CHANGELOG.md | 4 ++++ tests/covalent_dispatcher_tests/_cli/cli_test.py | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f125abfa4..013888ff6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [UNRELEASED] +### Operations + +- Ignore custom executor plugin in how-to's when running `test_deploy_status` CLI test. + ### Changed - Terraform output to use scrolling buffer. diff --git a/tests/covalent_dispatcher_tests/_cli/cli_test.py b/tests/covalent_dispatcher_tests/_cli/cli_test.py index 46d056b1f..ec02aa3f0 100644 --- a/tests/covalent_dispatcher_tests/_cli/cli_test.py +++ b/tests/covalent_dispatcher_tests/_cli/cli_test.py @@ -241,11 +241,25 @@ def test_deploy_status(mocker): Unit test for `covalent deploy status [executor_name]` command. """ + from covalent.executor import _executor_manager from covalent_dispatcher._cli.groups.deploy_group import status # Succeed with empty `executor_names` argument. + # Ignoring extra plugin(s) discovered in CI tests environment. + filtered_plugins_map = { + k: v + for k, v in _executor_manager.executor_plugins_map.items() + if k not in ["timing_plugin"] + } + mock_executor_manager = mocker.patch.object( + _executor_manager, + "executor_plugins_map", + return_value=filtered_plugins_map, + ) + ctx = click.Context(status) ctx.invoke(status, executor_names=[]) + mocker.stop(mock_executor_manager) # stop ignoring any plugins # Succeed with invalid `executor_names` argument. mock_click_style = mocker.patch("click.style")