Add test coverage#179
Merged
Merged
Conversation
- parse_env_var: accepts K=V (incl. multi-`=` values); rejects missing `=`, empty name, empty value, empty input - get_bundle_path: covers all four flag forms (`-b path`, `-b=path`, `--bundle path`, `--bundle=path`), absent flag, empty args, and `-b` with no following arg
Resolves #117 - exercises clap short-circuit paths; no Docker or runc required so runs as part of default `cargo test` - --oi-version output contains CARGO_PKG_VERSION - --oi-help output contains --oi-runtime-path - uses CARGO_BIN_EXE_oci-interceptor; no new deps
- modify_env_vars left spec_modified=false, so spec.save() was skipped and the env override was silently discarded unless paired with --oi-readonly-networking-mounts - caught by integration tests on first CI run against ubuntu-24.04
071c7d2 to
976d577
Compare
There was a problem hiding this comment.
Pull request overview
Adds automated test coverage around oci-interceptor behavior, including CLI smoke tests, Docker-based end-to-end integration tests, and new unit tests for parsing/option heuristics. This also wires the integration suite into CI and updates documentation for running tests locally.
Changes:
- Add Docker-gated end-to-end integration tests covering passthrough behavior, networking mount RO enforcement, env var overrides, and debug output files.
- Add always-on CLI smoke tests for clap short-circuit flags (
--oi-help,--oi-version) plus new unit tests for env var parsing and bundle flag detection. - Extend CI workflow and README to document/run the integration test suite; mark specs as modified when env var overrides are applied (so debug “modified” output is emitted).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/integration.rs |
New Docker-gated end-to-end suite exercising runtime wrapper behavior via the Docker daemon. |
tests/cli.rs |
New smoke tests ensuring --oi-help / --oi-version work without Docker. |
src/main.rs |
Marks env-var-driven spec edits as “modified” and adds unit tests for get_bundle_path. |
src/env_vars.rs |
Adds unit tests for parse_env_var edge cases. |
README.md |
Documents how to run unit vs. integration tests locally and in CI. |
.github/workflows/CI.yml |
Adds an integration job that configures Docker runtimes and runs the integration test suite. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Adds unit, CLI, and Docker-backed integration tests, plus a CI job that runs them on
ubuntu-24.04.Also fixes a latent bug where
--oi-env/--oi-env-forcemodifications were applied in memory but never persisted back toconfig.json(src/main.rs), caught by the new integration suite.