-
Notifications
You must be signed in to change notification settings - Fork 1
feat(core): add runtime support v0 boundary #354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
1989500
aba27f3
e87d891
6077a71
bf55bbf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -3,8 +3,9 @@ | |||||||||||
| //! Regression tests for Echo-owned optic artifact registration. | ||||||||||||
|
|
||||||||||||
| use warp_core::{ | ||||||||||||
| OpticAdmissionRequirements, OpticArtifact, OpticArtifactHandle, OpticArtifactOperation, | ||||||||||||
| OpticArtifactRegistrationError, OpticArtifactRegistry, OpticRegistrationDescriptor, | ||||||||||||
| GraphFact, OpticAdmissionRequirements, OpticArtifact, OpticArtifactHandle, | ||||||||||||
| OpticArtifactOperation, OpticArtifactRegistrationError, OpticArtifactRegistry, | ||||||||||||
| OpticRegistrationDescriptor, | ||||||||||||
| }; | ||||||||||||
|
|
||||||||||||
| fn fixture_artifact() -> OpticArtifact { | ||||||||||||
|
|
@@ -127,6 +128,30 @@ fn optic_artifact_registry_rejects_tampered_requirements_digest() -> Result<(), | |||||||||||
| Ok(()) | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| #[test] | ||||||||||||
| fn optic_artifact_registry_rejects_mismatched_stored_requirements_digest() -> Result<(), String> { | ||||||||||||
| let mut artifact = fixture_artifact(); | ||||||||||||
| artifact.requirements.digest = "requirements-digest:stored-mismatch".to_owned(); | ||||||||||||
| let mut registry = OpticArtifactRegistry::new(); | ||||||||||||
|
|
||||||||||||
| let err = registration_err_or_panic( | ||||||||||||
| registry.register_optic_artifact(artifact, fixture_descriptor()), | ||||||||||||
| "stored requirements digest mismatch should reject", | ||||||||||||
| )?; | ||||||||||||
|
|
||||||||||||
| assert!(matches!( | ||||||||||||
| err, | ||||||||||||
| OpticArtifactRegistrationError::RequirementsDigestMismatch | ||||||||||||
| )); | ||||||||||||
| assert_eq!(registry.len(), 0); | ||||||||||||
| assert!(registry.artifact_registration_receipts().is_empty()); | ||||||||||||
| assert!(registry | ||||||||||||
| .published_graph_facts() | ||||||||||||
| .iter() | ||||||||||||
| .all(|published| !matches!(published.fact, GraphFact::RuntimeSupportRecorded { .. }))); | ||||||||||||
|
Comment on lines
+148
to
+151
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strengthen side-effect assertion to block any fact publication on failed registration. This currently only forbids Suggested diff- assert!(registry
- .published_graph_facts()
- .iter()
- .all(|published| !matches!(published.fact, GraphFact::RuntimeSupportRecorded { .. })));
+ assert!(registry.published_graph_facts().is_empty());📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||
| Ok(()) | ||||||||||||
| } | ||||||||||||
|
|
||||||||||||
| #[test] | ||||||||||||
| fn optic_artifact_registry_rejects_mismatched_operation_id() -> Result<(), String> { | ||||||||||||
| let artifact = fixture_artifact(); | ||||||||||||
|
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.