[PR #153] [MERGED] test: remove redundant tests and merge similar tests #213

Closed
opened 2026-10-29 14:21:05 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/kvcache-ai/AgentENV/pull/153
Author: @LSX-s-Software
Created: 8/11/2026
Status: ✅ Merged
Merged: 8/11/2026
Merged by: @LSX-s-Software

Base: main ← Head: test/simplify


📝 Commits (1)

  • ca42dfd test: remove redundant tests and merge similar tests

📊 Changes

7 files changed (+182 additions, -460 deletions)

View changed files

📝 src/cfg.rs (+127 -260)
📝 src/cfg/image.rs (+34 -0)
📝 src/cfg/network.rs (+20 -0)
📝 src/sandbox/envd.rs (+1 -111)
📝 src/sandbox/firecracker/config.rs (+0 -10)
📝 src/sandbox/firecracker/instance.rs (+0 -67)
📝 src/setup/deps.rs (+0 -12)

📄 Description

What

Remove and consolidate unit tests that duplicate implementation details instead of testing owned behavior.

  • replace temporary TOML fixtures with direct, table-driven config validation
  • merge repeated disk rate-limit and OverlayBD path-collision cases
  • move image and network validation tests into their owning modules
  • remove tests that only assert defaults, direct field forwarding, or third-party deserialization
  • remove heavyweight HTTP mock harnesses for directly configured Firecracker fields and envd connection pooling

Why

Several tests repeated constants or simple assignments from production code. Others constructed temporary config files or mock HTTP servers without exercising additional AgentENV behavior.

This made the suite larger and more brittle without providing meaningful regression coverage. The remaining tests focus on validation rules, configuration relationships, and observable failure paths owned by AgentENV.

N/A.

Scope and non-goals

Included:

  • unit-test cleanup and reorganization
  • consolidation of related validation cases
  • removal of redundant test-only fixtures and helpers

Excluded:

  • runtime behavior changes
  • configuration or default-value changes
  • integration-test changes

Design and behavior changes

There are no runtime behavior changes.

Configuration tests now construct the relevant config objects directly and invoke their validation methods. Related invalid cases use table-driven assertions so each owned validation rule remains explicit without duplicating setup.

Tests that only mirrored direct assignments, builder options, or dependency-provided deserialization behavior were removed.

Compatibility and operations

  • Public API or generated protocol: N/A; no API or generated code changes.
  • Configuration or defaults: N/A; existing values and validation behavior are unchanged.
  • Snapshot manifest, artifact layout, or storage format: N/A; test-only changes.
  • Upgrade and rollback: N/A; no runtime impact.
  • Host requirements, permissions, ports, or dependencies: N/A; unchanged.

Validation

  • make fmt
  • make clippy
  • make test-unit
  • Relevant Rust integration tests
  • make -C services test (required when services/ changes)
  • Generated clients/server regenerated with the documented make target
  • Documentation updated
  • Benchmarks or performance comparison completed

Commands and results:

cargo test -p agentenv --lib
702 passed; 0 failed; 4 ignored

cargo fmt --all -- --check
passed

cargo clippy -p agentenv --lib --tests -- -D warnings
passed

Skipped checks and reasons:

  • Integration tests were not run because this PR only removes or reorganizes unit tests.
  • Services tests, code generation, documentation, and benchmarks are not applicable because their corresponding code and behavior are unchanged.

Risks and reviewer notes

Low risk. The retained tests continue to cover bundled config loading, supported memory snapshot combinations, disk rate limits, GC watermarks, path normalization, and OverlayBD configuration isolation.

Checklist

  • The PR contains one coherent change and no unrelated formatting or refactoring.
  • New behavior is covered by tests, or I explained why testing is impractical.
  • Logs and examples contain no credentials, tokens, or private registry information.
  • I did not manually edit generated code without updating its source and regenerating it.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/kvcache-ai/AgentENV/pull/153 **Author:** [@LSX-s-Software](https://github.com/LSX-s-Software) **Created:** 8/11/2026 **Status:** ✅ Merged **Merged:** 8/11/2026 **Merged by:** [@LSX-s-Software](https://github.com/LSX-s-Software) **Base:** `main` ← **Head:** `test/simplify` --- ### 📝 Commits (1) - [`ca42dfd`](https://github.com/kvcache-ai/AgentENV/commit/ca42dfde49ab48ed8f9b3c151b48bb096a34568a) test: remove redundant tests and merge similar tests ### 📊 Changes **7 files changed** (+182 additions, -460 deletions) <details> <summary>View changed files</summary> 📝 `src/cfg.rs` (+127 -260) 📝 `src/cfg/image.rs` (+34 -0) 📝 `src/cfg/network.rs` (+20 -0) 📝 `src/sandbox/envd.rs` (+1 -111) 📝 `src/sandbox/firecracker/config.rs` (+0 -10) 📝 `src/sandbox/firecracker/instance.rs` (+0 -67) 📝 `src/setup/deps.rs` (+0 -12) </details> ### 📄 Description ## What Remove and consolidate unit tests that duplicate implementation details instead of testing owned behavior. - replace temporary TOML fixtures with direct, table-driven config validation - merge repeated disk rate-limit and OverlayBD path-collision cases - move image and network validation tests into their owning modules - remove tests that only assert defaults, direct field forwarding, or third-party deserialization - remove heavyweight HTTP mock harnesses for directly configured Firecracker fields and envd connection pooling ## Why Several tests repeated constants or simple assignments from production code. Others constructed temporary config files or mock HTTP servers without exercising additional AgentENV behavior. This made the suite larger and more brittle without providing meaningful regression coverage. The remaining tests focus on validation rules, configuration relationships, and observable failure paths owned by AgentENV. ## Related issue N/A. ## Scope and non-goals Included: - unit-test cleanup and reorganization - consolidation of related validation cases - removal of redundant test-only fixtures and helpers Excluded: - runtime behavior changes - configuration or default-value changes - integration-test changes ## Design and behavior changes There are no runtime behavior changes. Configuration tests now construct the relevant config objects directly and invoke their validation methods. Related invalid cases use table-driven assertions so each owned validation rule remains explicit without duplicating setup. Tests that only mirrored direct assignments, builder options, or dependency-provided deserialization behavior were removed. ## Compatibility and operations - Public API or generated protocol: N/A; no API or generated code changes. - Configuration or defaults: N/A; existing values and validation behavior are unchanged. - Snapshot manifest, artifact layout, or storage format: N/A; test-only changes. - Upgrade and rollback: N/A; no runtime impact. - Host requirements, permissions, ports, or dependencies: N/A; unchanged. ## Validation - [x] `make fmt` - [x] `make clippy` - [x] `make test-unit` - [ ] Relevant Rust integration tests - [ ] `make -C services test` (required when `services/` changes) - [ ] Generated clients/server regenerated with the documented `make` target - [ ] Documentation updated - [ ] Benchmarks or performance comparison completed Commands and results: ```text cargo test -p agentenv --lib 702 passed; 0 failed; 4 ignored cargo fmt --all -- --check passed cargo clippy -p agentenv --lib --tests -- -D warnings passed ``` Skipped checks and reasons: - Integration tests were not run because this PR only removes or reorganizes unit tests. - Services tests, code generation, documentation, and benchmarks are not applicable because their corresponding code and behavior are unchanged. ## Risks and reviewer notes Low risk. The retained tests continue to cover bundled config loading, supported memory snapshot combinations, disk rate limits, GC watermarks, path normalization, and OverlayBD configuration isolation. ## Checklist - [x] The PR contains one coherent change and no unrelated formatting or refactoring. - [x] New behavior is covered by tests, or I explained why testing is impractical. - [x] Logs and examples contain no credentials, tokens, or private registry information. - [x] I did not manually edit generated code without updating its source and regenerating it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-29 14:21:05 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/AgentENV#213
No description provided.