Skip to content

test(yang-push): add black-box tests for the cache actor - #144

Open
riccardo-negri wants to merge 1 commit into
network-analytics:mainfrom
riccardo-negri:cache-actor-tests
Open

riccardo-negri wants to merge 1 commit into
network-analytics:mainfrom
riccardo-negri:cache-actor-tests

Conversation

@riccardo-negri

Copy link
Copy Markdown
Member

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.

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

Comment thread crates/yang-push/tests/cache/main.rs Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants