Repository navigation
Conversation
lforchini
requested review from
ntnx-matej-genci and
tmakatos
as code owners
September 28, 2026 12:50
lforchini
added this pull request to stack #55
September 28, 2026 12:50
The harness needs a VM the daemon can discover and scale without libvirt. JSON files carry the snapshot, and set_thread_count records each target so tests can assert behavior. Signed-off-by: Leonardo Forchini <leonardo.forchini@nutanix.com>
lforchini
force-pushed
the
test/06-fake-backend
branch
from
September 28, 2026 12:51
610b1cb to
5470fc1
Compare
tmakatos
reviewed
Sep 29, 2026
| //! | ||
| //! Each VM is one JSON file in `state_dir`. The pytest harness updates that | ||
| //! file; every snapshot re-reads it. `set_thread_count` writes the new count | ||
| //! back and appends the target to `calls.jsonl`. A sibling `.lock` file, |
| fn discover_vms(state_dir: &Path) -> Vec<Arc<Instance>> { | ||
| let entries = match fs::read_dir(state_dir) { | ||
| Ok(entries) => entries, | ||
| Err(error) => { |
Collaborator
There was a problem hiding this comment.
Shouldn't we expect in this case?
| let mut instances = Vec::new(); | ||
| for entry in entries.flatten() { | ||
| let path = entry.path(); | ||
| if path.extension().and_then(|ext| ext.to_str()) != Some("json") { |
Collaborator
There was a problem hiding this comment.
Are we expecting anything else other than .json files? I see you have similar logic below, if there's auxiliary files then put them in a directory and ignore that specific directory?
| /// Read one VM file, or log and return `None` when it cannot be parsed. | ||
| #[tracing::instrument(skip(path, id), fields(vm = id))] | ||
| fn read_vm(path: &std::path::Path, id: &str) -> Option<VmFile> { | ||
| let _guard = match LockGuard::acquire(&lock_path_for(path)) { |
Collaborator
There was a problem hiding this comment.
Shouldn't we expect in this case?
| default = ["threshold-engine", "qemu-backend", "tui"] | ||
| threshold-engine = [] | ||
| qemu-backend = ["dep:once_cell", "dep:virt"] | ||
| # In-process VM stand-in used by component tests. Not part of a production build. |
Collaborator
There was a problem hiding this comment.
I presume enabling this for tests land in a later commit?
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.
The harness needs a VM the daemon can discover and scale without
libvirt. JSON files carry the snapshot, and set_thread_count records
each target so tests can assert behavior.
Signed-off-by: Leonardo Forchini leonardo.forchini@nutanix.com
Stack created with GitHub Stacks CLI • Give Feedback 💬