Repository navigation
test(yang-push): add black-box tests for the cache actor - #144
Open
riccardo-negri wants to merge 1 commit into
Open
riccardo-negri wants to merge 1 commit into
riccardo-negri wants to merge 1 commit into
Conversation
riccardo-negri
force-pushed
the
cache-actor-tests
branch
from
December 3, 2026 16:28
c97a481 to
843f406
Compare
Add an integration test suite (tests/cache) that drives the YANG-Push schema cache through its lookup API and observes it only through its answers and what a fake NETCONF device over real SSH receives. It is meant as a regression net for refactoring the cache actor and netconf-proto without changing behaviour.
riccardo-negri
force-pushed
the
cache-actor-tests
branch
from
December 3, 2026 16:39
843f406 to
d1186cd
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The critical active finding shows the cache test suite is not registered with Cargo, so its tests will not compile or run.
1 open issue
What changed in this PR
Adds black-box integration coverage for the YANG-Push schema cache and its NETCONF-over-SSH interactions.
Changes:
- Tests lookup, caching, persistence, failures, retries, timeouts, and shutdown.
- Adds a fake SSH/NETCONF device with fault injection and RPC recording.
- Adds shared test harnesses and required Tokio test features.
| File | Description |
|---|---|
| crates/yang-push/tests/cache/main.rs | Defines the cache integration-test entrypoint and registers test modules. |
| crates/yang-push/tests/cache/lookups.rs | Tests cache lookup behavior and lifecycle semantics. |
| crates/yang-push/tests/cache/harness.rs | Provides cache test helpers and response assertions. |
| crates/yang-push/tests/cache/fake_device.rs | Implements a fake SSH/NETCONF device with request recording and fault injection. |
| crates/yang-push/tests/cache/device_fetch.rs | Tests device fetching, retries, failures, and protocol handling. |
| crates/yang-push/tests/cache/common.rs | Provides shared devices, sessions, subscriptions, and test fixtures. |
| crates/yang-push/Cargo.toml | Enables Tokio features required by the integration tests. |
Review effort: Lite
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.

Add an integration test suite (tests/cache) that drives the YANG-Push schema cache through its lookup API and observes it only through its answers and what a fake NETCONF device over real SSH receives. It is meant as a regression net for refactoring the cache actor and netconf-proto without changing behaviour.
More info in main.rs file and in the header of each file.