Skip to content

Commit eafb98d

Browse files
authored
fix: Make memory benchmark run again (#331)
1 parent 352e268 commit eafb98d

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

‎tests/perf/scenarios.py‎

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@
4343

4444
_DST_COMPOSITE = "http://cv.iptc.org/newscodes/digitalsourcetype/compositeWithTrainedAlgorithmicMedia"
4545

46+
# c2pa-rs >= 0.91 rejects manifests whose first action is not created or opened.
47+
_CREATED_ACTION = {
48+
"action": "c2pa.created",
49+
"softwareAgent": {"name": "perf_test"},
50+
"digitalSourceType": "http://cv.iptc.org/newscodes/digitalsourcetype/digitalCreation",
51+
}
52+
4653
_PARENT_ID = "xmp:iid:aaaaaaaa-0001-0001-0001-aaaaaaaaaaaa"
4754
_PLACED_ID = "xmp:iid:bbbbbbbb-0002-0002-0002-bbbbbbbbbbbb"
4855
_PARENT_ID2 = "xmp:iid:cccccccc-0003-0003-0003-cccccccccccc"
@@ -307,7 +314,7 @@ def scenario_builder_sign_jpeg_component_of(iterations: int = 100) -> None:
307314
"ingredients": [{"format": "image/jpeg", "relationship": "componentOf", "instance_id": _PLACED_ID}],
308315
"assertions": [{
309316
"label": "c2pa.actions.v2",
310-
"data": {"actions": [{
317+
"data": {"actions": [_CREATED_ACTION, {
311318
"action": "c2pa.placed",
312319
"softwareAgent": {"name": "perf_test"},
313320
"parameters": {"ingredientIds": [_PLACED_ID]},
@@ -411,7 +418,7 @@ def scenario_builder_sign_jpeg_two_components_same_mime(iterations: int = 100) -
411418
**MANIFEST_BASE,
412419
"assertions": [{
413420
"label": "c2pa.actions.v2",
414-
"data": {"actions": [{
421+
"data": {"actions": [_CREATED_ACTION, {
415422
"action": "c2pa.placed",
416423
"softwareAgent": {"name": "perf_test"},
417424
"parameters": {"ingredientIds": [_PLACED_ID4, _PLACED_ID5]},
@@ -441,7 +448,7 @@ def scenario_builder_sign_jpeg_two_components_mixed_mime(iterations: int = 100)
441448
**MANIFEST_BASE,
442449
"assertions": [{
443450
"label": "c2pa.actions.v2",
444-
"data": {"actions": [{
451+
"data": {"actions": [_CREATED_ACTION, {
445452
"action": "c2pa.placed",
446453
"softwareAgent": {"name": "perf_test"},
447454
"parameters": {"ingredientIds": [_PLACED_ID4, _PLACED_ID5]},
@@ -836,7 +843,7 @@ def scenario_builder_sign_jpeg_two_ingredient_archives(iterations: int = 100) ->
836843
**MANIFEST_BASE,
837844
"assertions": [{
838845
"label": "c2pa.actions.v2",
839-
"data": {"actions": [{
846+
"data": {"actions": [_CREATED_ACTION, {
840847
"action": "c2pa.placed",
841848
"softwareAgent": {"name": "perf_test"},
842849
"parameters": {"ingredientIds": [_ARCH_COMP_ID, _ARCH_COMP_ID2]},

0 commit comments

Comments
 (0)