Repository navigation
test(templates): validate generated Smart Contract Cargo metadata - #289
Open
ademolabiyi92-design wants to merge 1 commit into
Open
ademolabiyi92-design wants to merge 1 commit into
ademolabiyi92-design wants to merge 1 commit into
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Generated Smart Contract Cargo manifests previously had only a package-name smoke assertion. Add focused metadata conformance coverage that validates the generated structure, inherited dependencies and build/test configuration while preserving the existing template.
Related Issue
Closes #148
Scope
cargo metadata --offline --no-deps --format-version=1and assert the resolved member IDs, default members, source paths, library target and normal/dev dependencies.Testing
Windows / Node 24.21.0; Cargo semantic check ran with Rust/Cargo 1.98.1:
npm ci --ignore-scripts --no-audit --no-fund: passed (168 packages).npx vitest run tests/smart-contract-cargo-metadata.test.ts tests/smart-contract-template.test.ts: 7 passed, including the real Cargo metadata checks; none skipped.git diff --check: passed.npx vitest run --maxWorkers=2: 1705 passed, 70 failed, 12 skipped across 85 files (59 passed, 26 failed). Failures are in unchanged suites, including diagnostic/redaction behavior, workflow checks and Windows symlink permissions.src/types.js.The generated SDK was not installed/compiled; offline metadata and command/target conformance are not a substitute for
cargo testorstellar contract build. The current upstream CI YAML also has an audit step outside itsstepsblock; this PR does not modify protected workflow or unrelated baseline code.Security Impact
Security notes: test-only generation uses temporary directories with deterministic cleanup. Cargo is invoked with an argument array, shell disabled, offline/no-deps flags and a timeout. No dependencies, deployment behavior, credentials, or production process handling are changed.
Release Impact
Release notes: tests and contributor documentation only.
Documentation
Checklist
docs/contributing/wave-architecture.mdfor Stellar Wave work