Skip to content

Commit 48f6bc5

Browse files
dheerajodhaclaude
andcommitted
fix: add missing image manifest mocks to remaining tests
Add ec.oci.image_manifests mocks to tests that were timing out due to network calls under network isolation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ec4d089 commit 48f6bc5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

policy/release/slsa_build_scripted_build/slsa_build_scripted_build_test.rego

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ test_all_good if {
3030
assertions.assert_empty(slsa_build_scripted_build.deny) with input.image as image
3131
with input.attestations as [_mock_attestation(tasks)]
3232
with data.trusted_tasks as trusted_tasks
33+
with ec.oci.image_manifests as _mock_image_manifests
3334
}
3435

3536
# It's unclear if this should be allowed or not. This unit test exists to

policy/release/tasks/tasks_test.rego

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ test_failed_tasks if {
5555
"buildConfig": {"tasks": given_tasks},
5656
},
5757
}}]
58+
with ec.oci.image_manifests as _mock_image_manifests
5859

5960
slsav1_tasks := [
6061
tekton_test.with_bundle(tekton_test.slsav1_task("buildah"), _bundle),
@@ -82,13 +83,15 @@ test_failed_tasks if {
8283
{"pipelines.openshift.io/runtime": "generic"},
8384
{},
8485
)]
86+
with ec.oci.image_manifests as _mock_image_manifests
8587
}
8688

8789
test_required_tasks_met if {
8890
attestations := _attestations_with_tasks(_slsav02_expected_required_tasks, [])
8991
assertions.assert_empty(tasks.deny) with data["pipeline-required-tasks"] as _required_pipeline_tasks
9092
with data.trusted_tasks as _trusted_tasks
9193
with input.attestations as attestations
94+
with ec.oci.image_manifests as _mock_image_manifests
9295

9396
slsav1_attestations := [tekton_test.slsav1_attestation(_slsav1_expected_required_tasks)]
9497
assertions.assert_empty(tasks.deny) with data["pipeline-required-tasks"] as _required_pipeline_tasks
@@ -102,6 +105,7 @@ test_required_tasks_met_no_label if {
102105
with data["pipeline-required-tasks"] as {}
103106
with data.trusted_tasks as _trusted_tasks
104107
with input.attestations as attestations
108+
with ec.oci.image_manifests as _mock_image_manifests
105109

106110
attestations_no_label := _attestations_with_tasks_no_label(_slsav02_expected_required_tasks, [])
107111
assertions.assert_empty(tasks.deny) with data["required-tasks"] as _time_based_required_tasks
@@ -155,6 +159,7 @@ test_required_tasks_not_met if {
155159
) with data["pipeline-required-tasks"] as _required_pipeline_tasks
156160
with data.trusted_tasks as _trusted_tasks
157161
with input.attestations as attestations
162+
with ec.oci.image_manifests as _mock_image_manifests
158163

159164
slsav1_filtered_tasks := [task |
160165
some task in _slsav1_expected_required_tasks
@@ -225,9 +230,11 @@ test_extra_tasks_ignored if {
225230
assertions.assert_empty(tasks.deny) with data["pipeline-required-tasks"] as _required_pipeline_tasks
226231
with data.trusted_tasks as _trusted_tasks
227232
with input.attestations as attestations
233+
with ec.oci.image_manifests as _mock_image_manifests
228234
assertions.assert_empty(tasks.warn) with data["pipeline-required-tasks"] as _required_pipeline_tasks
229235
with data.trusted_tasks as _trusted_tasks
230236
with input.attestations as attestations
237+
with ec.oci.image_manifests as _mock_image_manifests
231238

232239
slsav1_attestations := [tekton_test.slsav1_attestation_full(
233240
array.concat(

0 commit comments

Comments
 (0)