fix: preserve unknown assets and retained export-copy ownership
This commit is contained in:
1 parent
55a82fdc5f
commit
f21781f170
8 files changed
+312
-10
No files matched your search
@@ -72,6 +72,33 @@ def test_assets_require_correct_library_references_and_unknown_bytes(project):
|
||||
asset_identity(source, library)
|
||||
|
||||
|
||||
@pytest.mark.parametrize('relative', ['database/cdbsvr/persistent.dat',
|
||||
'database/cdbsvr/new-engineering/config.bin', 'database/cdbsvr/events/custom.dat',
|
||||
'database/cdbsvr/plog/unknown-engineering.bin'])
|
||||
def test_unknown_cdbsvr_assets_remain_part_of_identity(project, relative):
|
||||
from cbb_refresh_verify.native_engineering_identity import asset_identity
|
||||
source, library = project
|
||||
baseline = asset_identity(source, library)
|
||||
unknown = source.parent/relative; unknown.parent.mkdir(parents=True, exist_ok=True)
|
||||
unknown.write_bytes(b'first engineering content')
|
||||
added = asset_identity(source, library)
|
||||
assert added != baseline
|
||||
unknown.write_bytes(b'changed engineering content')
|
||||
assert asset_identity(source, library) != added
|
||||
unknown.unlink()
|
||||
assert asset_identity(source, library) == baseline
|
||||
|
||||
|
||||
def test_observed_guid_and_events_runtime_does_not_change_identity(project):
|
||||
from cbb_refresh_verify.native_engineering_identity import asset_identity
|
||||
source, library = project
|
||||
baseline = asset_identity(source, library)
|
||||
for relative in ['database/cdbsvr/plog/2026.11.03.guid.48432.txt',
|
||||
'database/cdbsvr/events/events.dat', 'database/cdbsvr/events/events.idx']:
|
||||
path = source.parent/relative; path.parent.mkdir(parents=True, exist_ok=True); path.write_bytes(b'runtime')
|
||||
assert asset_identity(source, library) == baseline
|
||||
|
||||
|
||||
@pytest.mark.parametrize('failure', ['empty', 'missing_completion', 'error', 'exit'])
|
||||
def test_export_evidence_requires_successful_complete_native_output(tmp_path, failure):
|
||||
from cbb_refresh_verify.native_engineering_identity import validate_export_output
|
||||
@@ -94,11 +121,13 @@ def test_capture_only_exports_fresh_copy_and_leaves_source_unchanged(project, tm
|
||||
source, library = project
|
||||
original = build_manifest(source.parent)
|
||||
monkeypatch.setattr(identity, 'check_exporters', lambda _: None)
|
||||
monkeypatch.setattr(identity, '_process_snapshot', lambda: [])
|
||||
def exports(clone, root, *_):
|
||||
assert clone.parent == root/'project' and clone != source
|
||||
(clone.parent/'database/icdb.dat').write_bytes(b'export changed disposable copy')
|
||||
(root/'design.rpt').write_bytes(ascii_report())
|
||||
(root/'design.edf').write_bytes(edif_report())
|
||||
(root/'export-launch.json').write_text('{"started": false}')
|
||||
return {'success': True, 'safe_to_continue': True, 'detail': ''}
|
||||
monkeypatch.setattr(identity, '_run_exports', exports)
|
||||
monkeypatch.setattr(identity, 'csv_identity', lambda _: {'work/identity': 'csv proof'})
|
||||
|
||||
Reference in new issue
Block a user