From fe5546657d6cfa83c773c86d470f72737e320d5a Mon Sep 17 00:00:00 2001 From: teseoch Date: Thu, 24 Oct 2024 16:11:15 -0700 Subject: [PATCH 1/2] added platform to integration tests --- applications/integration_test.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/applications/integration_test.py b/applications/integration_test.py index cd9c59a8db..2b75e7148c 100644 --- a/applications/integration_test.py +++ b/applications/integration_test.py @@ -2,6 +2,7 @@ import sys import os +import platform import json import subprocess import tempfile @@ -86,6 +87,11 @@ def run_one(self, executable, config_folder, config): print(res.stdout.decode('utf-8')) self.assertEqual(res.returncode, 0, f"{res.returncode} != 0") + + if "platform" in config and config["platform"] != "" and config["platform"] != platform.system(): + print(f"Skipping checks for {test_file_name} because the platform is {platform.system()} and the test is for {config['platform']}") + continue + with open(oracle_file.name, "r") as fp: result = json.load(fp) From 4d2f7783697604961d1683abb5bfa687d8111ee0 Mon Sep 17 00:00:00 2001 From: Michael Tao Date: Sat, 26 Oct 2024 13:42:00 -0400 Subject: [PATCH 2/2] moving platform check to suite generation rather than per test --- applications/integration_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/applications/integration_test.py b/applications/integration_test.py index befd59d868..d160591ff1 100644 --- a/applications/integration_test.py +++ b/applications/integration_test.py @@ -130,9 +130,6 @@ def run_one(self, test_file): self.assertEqual(res.returncode, 0, f"{res.returncode} != 0") - if "platform" in config and config["platform"] != "" and config["platform"] != platform.system(): - print(f"Skipping checks for {test_file_name} because the platform is {platform.system()} and the test is for {config['platform']}") - continue with open(oracle_file.name, "r") as fp: result = json.load(fp) @@ -175,6 +172,9 @@ def make_suite(config_file, single_application = None, single_config = None): suite = unittest.TestSuite() for key,value in config.items(): + if "platform" in value and value["platform"] != "" and value["platform"] != platform.system(): + print(f"Skipping checks for application {key} because the platform is {platform.system()} and the test is for {config['platform']}") + continue if single_application is None or key == single_application: # expects a list of configs to run suite.addTest(IntegrationTest(key,value, None if single_config is None else [single_config]))