Skip to content

Commit

Permalink
Attempt to fix test_mcupdater in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Aug 26, 2024
1 parent 7c4c3ea commit bc540d9
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions suite/auto-sync/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ vendor/llvm_root
src/auto-sync/config.json
src/autosync/cpptranslator/Tests/Differ/test_saved_patches.json
src/autosync.egg-info
src/autosync/Tests/MCUpdaterTests/ARCH/Output
src/autosync/Tests/MCUpdaterTests/Disassembler/ARCH/Output
src/autosync/lit_config/test_dir_*
src/autosync/lit_config/.lit_test_times.txt
src/autosync/Tests/MCUpdaterTests/test_output

This file was deleted.

This file was deleted.

This file was deleted.

14 changes: 9 additions & 5 deletions suite/auto-sync/src/autosync/Tests/test_mcupdater.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from autosync.MCUpdater import MCUpdater


mutex = Lock()


class TestHeaderPatcher(unittest.TestCase):
@classmethod
def setUpClass(cls):
Expand All @@ -21,10 +24,9 @@ def setUpClass(cls):
format="%(levelname)-5s - %(message)s",
force=True,
)
cls.mutex = Lock()

def test_unified_test_cases(self):
with self.mutex:
with mutex:
out_dir = Path(
get_path("{MCUPDATER_TEST_OUT_DIR}")
.joinpath("merged")
Expand All @@ -48,7 +50,7 @@ def test_unified_test_cases(self):
)

def test_separated_test_cases(self):
with self.mutex:
with mutex:
out_dir = Path(
get_path("{MCUPDATER_TEST_OUT_DIR}")
.joinpath("merged")
Expand All @@ -72,7 +74,7 @@ def test_separated_test_cases(self):
)

def test_multi_mode_unified_test_cases(self):
with self.mutex:
with mutex:
out_dir = Path(
get_path("{MCUPDATER_TEST_OUT_DIR}")
.joinpath("multi")
Expand Down Expand Up @@ -103,7 +105,7 @@ def test_multi_mode_unified_test_cases(self):
)

def test_multi_mode_separated_test_cases(self):
with self.mutex:
with mutex:
out_dir = Path(
get_path("{MCUPDATER_TEST_OUT_DIR}")
.joinpath("multi")
Expand Down Expand Up @@ -163,6 +165,8 @@ def compare_files(self, out_dir: Path, filenames: list[str]) -> bool:
actual = f.read()
if expected != actual:
logging.error("Files mismatch")
print(f"Expected: {efile}")
print(f"Actual: {afile}\n")
print(f"Expected:\n\n{expected}\n")
print(f"Actual:\n\n{actual}\n")
return False
Expand Down

0 comments on commit bc540d9

Please sign in to comment.