From 67b68cae28b2454fade2e64b6897bbb8200a0b33 Mon Sep 17 00:00:00 2001 From: konstin Date: Sun, 21 Sep 2025 12:03:10 +0200 Subject: [PATCH] . --- scripts/ecosystem-testing/compare.py | 42 ++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 scripts/ecosystem-testing/compare.py diff --git a/scripts/ecosystem-testing/compare.py b/scripts/ecosystem-testing/compare.py new file mode 100644 index 000000000..eb2b2f513 --- /dev/null +++ b/scripts/ecosystem-testing/compare.py @@ -0,0 +1,42 @@ +import argparse +import difflib +import sys +from pathlib import Path + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("base", type=Path) + parser.add_argument("branch", type=Path) + args = parser.parse_args() + + total = 0 + differences = 0 + for package in args.base.iterdir(): + if not package.is_dir(): + continue + package_branch = args.branch.joinpath(package.name) + if not package_branch.is_dir(): + print(f"Package {package} not found in branch") + continue + stdout = package.joinpath("stdout.txt").read_text() + stdout_branch = package_branch.joinpath("stdout.txt").read_text() + if stdout != stdout_branch: + differences += 1 + print("--------------------------------") + print(f"Package {package}") + sys.stdout.writelines( + difflib.unified_diff( + stdout.splitlines(keepends=True), + stdout_branch.splitlines(keepends=True), + fromfile="base", + tofile="branch", + ) + ) + total += 1 + + print(f"Different packages: {differences}/{total}") + + +if __name__ == "__main__": + main()