Skip to content

Commit

Permalink
Add windows and linux test separation
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Abrahão <[email protected]>
  • Loading branch information
patrickpa committed Aug 22, 2024
1 parent b8ff20d commit 81b6871
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 8 deletions.
7 changes: 0 additions & 7 deletions runtime/tests/test_data/framework_manifest.json

This file was deleted.

7 changes: 7 additions & 0 deletions runtime/tests/test_data/linux/framework_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"manifest_file_path": [
"tests/test_data/linux/demo_checker_bundle_manifest.json",
"tests/test_data/linux/result_pooling_manifest.json",
"tests/test_data/linux/text_report_manifest.json"
]
}
10 changes: 10 additions & 0 deletions runtime/tests/test_data/windows/demo_checker_bundle_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "DemoCheckerBundle",
"exec_type": "executable",
"module_type": "checker_bundle",
"exec_command": "cd '$env:ASAM_QC_FRAMEWORK_WORKING_DIR' -and ..\\..\\bin\\DemoCheckerBundle.exe $env:ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
7 changes: 7 additions & 0 deletions runtime/tests/test_data/windows/framework_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"manifest_file_path": [
"tests\\test_data\\windows\\demo_checker_bundle_manifest.json",
"tests\\test_data\\windows\\result_pooling_manifest.json",
"tests\\test_data\\windows\\text_report_manifest.json"
]
}
10 changes: 10 additions & 0 deletions runtime/tests/test_data/windows/result_pooling_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "ResultPooling",
"exec_type": "executable",
"module_type": "result_pooling",
"exec_command": "cd $env:ASAM_QC_FRAMEWORK_WORKING_DIR -and ..\\..\\bin\\ResultPooling.exe $env:ASAM_QC_FRAMEWORK_WORKING_DIR $env:ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
10 changes: 10 additions & 0 deletions runtime/tests/test_data/windows/text_report_manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"module": [
{
"name": "TextReport",
"exec_type": "executable",
"module_type": "report_module",
"exec_command": "cd $env:ASAM_QC_FRAMEWORK_WORKING_DIR && ..\\..\\bin\\TextReport.exe $env:ASAM_QC_FRAMEWORK_CONFIG_FILE"
}
]
}
17 changes: 16 additions & 1 deletion runtime/tests/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@
import runtime.runtime as runtime


def on_windows() -> bool:
"""Check if script is executed in Windows OS
Returns:
bool: True if executing the script on Windows
"""
return os.name == "nt"


def launch_main(monkeypatch, config_file_path: str, manifest_file_path: str):
monkeypatch.setattr(
sys,
Expand All @@ -27,7 +36,13 @@ def test_3steps_manifest(monkeypatch):
cwd = os.getcwd()
config_xml = os.path.join(cwd, "tests", "test_data", "3step_config.xml")

manifest_json = os.path.join(cwd, "tests", "test_data", "framework_manifest.json")
os_path = "linux"
if on_windows():
os_path = "windows"

manifest_json = os.path.join(
cwd, "tests", "test_data", os_path, "framework_manifest.json"
)

launch_main(monkeypatch, config_xml, manifest_json)

Expand Down

0 comments on commit 81b6871

Please sign in to comment.