Skip to content

Commit

Permalink
fix(#3969): renamed parameter and minnor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Rebits authored and juliamagan committed Sep 7, 2023
1 parent fb9b65f commit 84cd718
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 20 deletions.
9 changes: 3 additions & 6 deletions deps/wazuh_testing/wazuh_testing/tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,9 @@ def get_random_string(string_length, digits=True):


def get_version():
try:
f = open('../../version.json')
data = json.load(f)
version = data['version']
except Exception:
version = 'N/A'
f = open('../../version.json')
data = json.load(f)
version = data['version']
return version


Expand Down
10 changes: 4 additions & 6 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def get_report_files():
def pytest_collection_modifyitems(session, config, items):
selected_tests = []
deselected_tests = []
print(session)
print(config)
if not global_parameters.allow_platform_deselected_tests:
if not global_parameters.avoid_platform_based_deselection:
for item in items:
supported_platforms = PLATFORMS.intersection(mark.name for mark in item.iter_markers())
plat = sys.platform
Expand Down Expand Up @@ -341,7 +339,7 @@ def pytest_addoption(parser):
)

parser.addoption(
"--allow-platform-deselected-tests",
"--avoid-platform-based-deselection",
action="store_true",
default=False,
help="Avoid tests deselection based on current environment"
Expand Down Expand Up @@ -416,7 +414,7 @@ def pytest_configure(config):
global_parameters.wpk_package_path = global_parameters.wpk_package_path

# Set collect test mode
global_parameters.allow_platform_deselected_tests = config.getoption("--allow-platform-deselected-tests")
global_parameters.avoid_platform_based_deselection = config.getoption("--avoid_platform_based_deselection")



Expand Down Expand Up @@ -1311,4 +1309,4 @@ def pytest_deselected(items):
reporter = config.pluginmanager.getplugin("terminalreporter")
reporter.ensure_newline()
for item in items:
reporter.line(f"deselected: {item.nodeid}", yellow=True, bold=True)
reporter.line(f"deselected: {item.nodeid}", yellow=True, bold=True)
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,10 @@


# Preparing

@pytest.fixture(scope='module', params=configurations)
def get_configuration(request):
"""Get configurations from the module."""
return request.param
@pytest.fixture(scope='module', autouse=True)
def truncate_logs():
"""Truncate the 'ossec.log' file."""
truncate_file(LOG_FILE_PATH)


# fixtures
Expand Down
2 changes: 1 addition & 1 deletion tests/performance/test_api/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,4 @@ def pytest_collection_modifyitems(session, config, items):
# Add each test_case metadata as user_properties for its item
for item in items:
if hasattr(item, 'callspec') and 'test_case' in item.callspec.params:
item.user_properties.extend([(key, value) for key, value in item.callspec.params['test_case'].items()])
item.user_properties.extend([(key, value) for key, value in item.callspec.params['test_case'].items()])
2 changes: 1 addition & 1 deletion tests/performance/test_cluster/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def pytest_addoption(parser):
# Get command line options
parser.addoption(
"--performance-artifacts_path",
"--artifacts_path",
action="store",
type=str,
help="Path where information of all cluster nodes can be found (logs, stats CSVs, etc)."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
def pytest_addoption(parser):
# Get command line options
parser.addoption(
"--reliability-artifacts-path",
"--artifacts_path",
action="store",
type=str,
help="Path where information of all cluster nodes can be found (logs, stats CSVs, etc)."
Expand Down

0 comments on commit 84cd718

Please sign in to comment.