Gitea CI / Check code and tests (pull_request) Failing after 10m33s
Gitea CI / Build Android APK (pull_request) Skipped
Gitea CI / Build Windows x64 app (pull_request) Skipped
Gitea CI / Audit and package Windows x64 (pull_request) Skipped
Gitea CI / Assemble and validate CI artifacts (pull_request) Skipped
Gitea CI / Gitea CI passed (pull_request) Failing after 2s
53 lines
2.2 KiB
Python
53 lines
2.2 KiB
Python
import tempfile
|
|
import unittest
|
|
from pathlib import Path
|
|
|
|
from check_windows_release import REQUIRED, audit
|
|
|
|
|
|
class DependencyGateTest(unittest.TestCase):
|
|
def setUp(self):
|
|
self.temp = tempfile.TemporaryDirectory()
|
|
self.addCleanup(self.temp.cleanup)
|
|
self.root = Path(self.temp.name)
|
|
for name in REQUIRED:
|
|
path = self.root / name
|
|
path.parent.mkdir(parents=True, exist_ok=True)
|
|
path.touch()
|
|
(self.root / 'data/flutter_assets').mkdir()
|
|
|
|
def test_vc_runtime_in_another_worker_does_not_satisfy_app(self):
|
|
(self.root / 'processing/workers/asr/vcruntime140.dll').touch()
|
|
with self.assertRaisesRegex(ValueError, 'cutdex.exe -> vcruntime140.dll'):
|
|
audit(self.root, lambda p: ['vcruntime140.dll'] if p.name == 'cutdex.exe' else [])
|
|
|
|
def test_unknown_dependency_is_not_assumed_to_be_a_system_dll(self):
|
|
with self.assertRaisesRegex(ValueError, 'vendor.dll'):
|
|
audit(self.root, lambda p: ['vendor.dll'])
|
|
|
|
def test_local_runtime_and_inbox_api_sets_pass(self):
|
|
(self.root / 'VCRUNTIME140.dll').touch()
|
|
result = audit(self.root, lambda p: ['vcruntime140.dll', 'KERNEL32.dll',
|
|
'VERSION.dll', 'COMCTL32.dll', 'api-ms-win-crt-runtime-l1-1-0.dll'] if p.name == 'cutdex.exe' else [])
|
|
self.assertEqual(result['unresolved'], [])
|
|
self.assertFalse(result['cleanSystemValidated'])
|
|
|
|
def test_missing_flutter_aot_is_rejected(self):
|
|
(self.root / 'data/app.so').unlink()
|
|
with self.assertRaisesRegex(ValueError, 'data/app.so'):
|
|
audit(self.root, lambda p: [])
|
|
|
|
def test_native_flutter_plugin_is_required_after_migration(self):
|
|
(self.root / 'cutdex_native_flutter_plugin.dll').unlink()
|
|
(self.root / 'cutdex_runtime_plugin.dll').touch()
|
|
with self.assertRaisesRegex(ValueError, 'cutdex_native_flutter_plugin.dll'):
|
|
audit(self.root, lambda p: [], require_processing=False)
|
|
|
|
def test_jvm_is_not_assumed_to_be_a_system_dependency(self):
|
|
with self.assertRaisesRegex(ValueError, 'jvm.dll'):
|
|
audit(self.root, lambda p: ['jvm.dll'] if p.name == 'cutdex.exe' else [])
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|