Recover camera session failures once with low-resolution native YUV
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
import unittest
|
||||
import tempfile,sys
|
||||
from unittest.mock import patch
|
||||
ROOT=Path(__file__).resolve().parents[2]
|
||||
spec=importlib.util.spec_from_file_location('presence_package',ROOT/'scripts/package-avatar-emotion.py')
|
||||
@@ -18,6 +19,27 @@ class PresencePackageTests(unittest.TestCase):
|
||||
with patch.object(pack,'tested_source'),patch.object(pack,'packaging_tests_current'),patch.object(pack,'read_json',return_value={'edges':[{'nativeLoop':True}]}),patch.object(pack,'next_version',return_value=24),patch.object(pack.subprocess,'run',side_effect=stop_build):
|
||||
with self.assertRaises(ValueError):pack.publish({'manifest_sha256':pack.RUNTIME_FIX_PIN},None,24,full=True,startup_fix=True,face_diagnostics_fix=True)
|
||||
with self.assertRaisesRegex(RuntimeError,'build_sentinel'):pack.publish({'manifest_sha256':pack.RUNTIME_FIX_PIN},None,24,full=True,startup_fix=True,presence_candidate=True,face_diagnostics_fix=True)
|
||||
def test_camera_compatibility_release_requires_diagnostics_replay_and_fresh_code(self):
|
||||
def stop_build(command,**kwargs):
|
||||
if command[0]=='python3': return
|
||||
for flag in ('-PcameraCompatibilityFix=true','-PfaceDiagnosticsFix=true',
|
||||
'-PpresenceCandidate=true','-PavatarStartupFix=true','-PactionVersionCode=25'):
|
||||
self.assertIn(flag,command)
|
||||
raise RuntimeError('build_sentinel')
|
||||
with patch.object(pack,'tested_source'),patch.object(pack,'packaging_tests_current'),patch.object(pack,'read_json',
|
||||
return_value={'edges':[{'nativeLoop':True}],'camera_callback_replay':True}),patch.object(pack,'next_version',return_value=25), patch.object(pack.subprocess,'run',side_effect=stop_build):
|
||||
with self.assertRaises(ValueError): pack.publish({'manifest_sha256':pack.RUNTIME_FIX_PIN},None,25,
|
||||
full=True,startup_fix=True,presence_candidate=True,camera_compatibility_fix=True)
|
||||
with self.assertRaisesRegex(RuntimeError,'build_sentinel'): pack.publish({'manifest_sha256':pack.RUNTIME_FIX_PIN},None,25,
|
||||
full=True,startup_fix=True,presence_candidate=True,face_diagnostics_fix=True,camera_compatibility_fix=True)
|
||||
def test_camera_cli_is_one_purpose_not_two_inherited_flags(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
args=['package-avatar-emotion.py','--manifest',str(ROOT/'app/src/main/assets'/pack.ASSET_ROOT/'manifest.json'),
|
||||
'--sha256',pack.RUNTIME_FIX_PIN,'--output',str(Path(folder)/'evidence'),'--camera-compatibility-fix']
|
||||
with patch.object(sys,'argv',args),patch.object(pack,'check_bundle',side_effect=RuntimeError('gate_sentinel')):
|
||||
with self.assertRaisesRegex(RuntimeError,'gate_sentinel'): pack.main()
|
||||
with patch.object(sys,'argv',args+['--face-diagnostics-fix']):
|
||||
with self.assertRaisesRegex(ValueError,'choose one build purpose'): pack.main()
|
||||
def test_fresh_presence_version_requires_startup_and_frozen_pack(self):
|
||||
report={'manifest_sha256':pack.RUNTIME_FIX_PIN}
|
||||
def stop_build(command,**kwargs):
|
||||
|
||||
Reference in New Issue
Block a user