From 75dd2fedfde8566cda32b7a1c134fa04f3eaa1a0 Mon Sep 17 00:00:00 2001 From: Anastasiia Shevchuk Date: Mon, 10 Feb 2025 14:42:41 +0100 Subject: [PATCH] testlib_refactor: create targets for unit- and system level test helpers Add Bazel target for unit tests - 'testlib_unit' and for system level tests - 'testlib_system_level'. The idea is to restrict usage of specific helpers depending on the test level. Jira ticket: CMK-21344 Change-Id: Ief24afef783da9323ef594712b792369719734f7 --- tests/BUILD | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/BUILD b/tests/BUILD index fca304da786..cbb1ec55023 100644 --- a/tests/BUILD +++ b/tests/BUILD @@ -33,3 +33,39 @@ py_library( requirement("pytest-metadata"), ], ) + +py_library( + name = "testlib_system_level", + testonly = True, + srcs = ["__init__.py"] + glob( + include = ["testlib/**"], + exclude = ["testlib/unit/**"], + ), + imports = [".."], + deps = [ + "//cmk:lib_cmk", + requirement("beautifulsoup4"), + requirement("cryptography"), + requirement("docker"), + requirement("dockerpty"), + requirement("pexpect"), + requirement("playwright"), + requirement("pytest"), + requirement("requests"), + ], +) + +py_library( + name = "testlib_unit", + testonly = True, + srcs = ["__init__.py"] + glob(include = [ + "testlib/unit/**", + "testlib/common/**", + ]), + imports = [".."], + deps = [ + "//cmk:lib_cmk", + requirement("pexpect"), + requirement("pytest"), + ], +)