From d57703086b194a87013bc36c93dc4e1f280ab961 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Mon, 16 Nov 2026 03:38:51 +0100 Subject: [PATCH] Regression test exact Atelier archive preservation and guarded retries --- .forgejo/workflows/kit-delivery.yml | 2 +- network/server-control/test_atelier_compat.py | 31 +++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 network/server-control/test_atelier_compat.py diff --git a/.forgejo/workflows/kit-delivery.yml b/.forgejo/workflows/kit-delivery.yml index 63985cd5..27bed64a 100644 --- a/.forgejo/workflows/kit-delivery.yml +++ b/.forgejo/workflows/kit-delivery.yml @@ -31,7 +31,7 @@ jobs: gradle-version: '9.2.1' - name: Verify bridge and build native kit items run: | - python3 -m unittest discover -s network/server-control -p 'test_kit_equipment.py' -v + python3 -m unittest discover -s network/server-control -p 'test_*.py' -v gradle --no-daemon -p DuneKits test jar - name: Upload verified kit plugin uses: actions/upload-artifact@v3 diff --git a/network/server-control/test_atelier_compat.py b/network/server-control/test_atelier_compat.py new file mode 100644 index 00000000..8870383a --- /dev/null +++ b/network/server-control/test_atelier_compat.py @@ -0,0 +1,31 @@ +import hashlib +import importlib.util +from pathlib import Path +import tempfile +import unittest +import zipfile + + +class AtelierArchiveTest(unittest.TestCase): + def test_patch_preserves_unrelated_menu_and_quest_entries(self): + spec = importlib.util.spec_from_file_location('installer', Path(__file__).with_name('install-atelier-compat.py')) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + with tempfile.TemporaryDirectory(prefix='dune-atelier-test-') as directory: + target, artifact = Path(directory)/'original.jar', Path(directory)/'compat.jar' + with zipfile.ZipFile(target, 'w') as output: + output.writestr('plugin.yml', 'name: DuneAtelier\nversion: 1.0.0\n') + output.writestr('Unchanged.class', b'original-menu-and-quest-code') + for name in module.CLASSES: + output.writestr(name, b'original-adapter') + with zipfile.ZipFile(artifact, 'w') as output: + for name in module.CLASSES: + output.writestr(name, b'\xca\xfe\xba\xbefixture-adapter') + module.BASELINE = hashlib.sha256(target.read_bytes()).hexdigest() + module.Path = lambda value: target if str(value) == '/opt/dunerealms/lobby/plugins/DuneAtelier-1.0.0.jar' else Path(value) + module.install(artifact, True) + with zipfile.ZipFile(target) as result: + self.assertEqual(result.read('Unchanged.class'), b'original-menu-and-quest-code') + self.assertIn('softdepend: [DuneKits]', result.read('plugin.yml').decode()) + with self.assertRaises(RuntimeError): + module.install(artifact, True)