Skip to content

chore: improve tests#262

Merged
lxfontes merged 1 commit intomainfrom
test-improvements
Jan 27, 2026
Merged

chore: improve tests#262
lxfontes merged 1 commit intomainfrom
test-improvements

Conversation

@ricochet
Copy link
Contributor

@ricochet ricochet commented Jan 27, 2026

We have one test that does a lot of heavy lifting.
I considered deleting and starting over, but instead opted to
clean it up and make it more maintainable.

crates/wash-runtime/tests/integration_http_counter.rs:

  • Removed ~100 lines of ASCII art/decorative println! output across 3 test functions
  • Removed 35 lines of commented-out test code (restricted outbound access test with TODO)
  • Extracted 3 shared helper functions (http_counter_host_interfaces, start_host_with_all_plugins,
    http_counter_workload_request) to eliminate copy-paste setup across all 3 tests

crates/wash-runtime/src/plugin/wasi_blobstore/in_memory.rs

  • Replaced 5 trivial struct-field tests with 4 behavioral tests

crates/wash-runtime/src/plugin/wasi_keyvalue/in_memory.rs

  • Replaced 4 trivial tests with 3 behavioral tests

For oci.rs, removed tests that only tested HashMap/BTreeMap insertion

crates/wash/src/cli/wit.rs - Fixed 2 tests to call actual code

We have one test that does a lot of heavy lifting.
I considered deleting and starting over, but instead opted to
clean it up and make it more maintainable.

crates/wash-runtime/tests/integration_http_counter.rs:
- Removed ~100 lines of ASCII art/decorative println! output across 3 test functions
- Removed 35 lines of commented-out test code (restricted outbound access test with TODO)
- Extracted 3 shared helper functions (http_counter_host_interfaces, start_host_with_all_plugins,
http_counter_workload_request) to eliminate copy-paste setup across all 3 tests

crates/wash-runtime/src/plugin/wasi_blobstore/in_memory.rs
- Replaced 5 trivial struct-field tests with 4 behavioral tests

crates/wash-runtime/src/plugin/wasi_keyvalue/in_memory.rs
- Replaced 4 trivial tests with 3 behavioral tests

For oci.rs, removed tests that only tested HashMap/BTreeMap insertion

crates/wash/src/cli/wit.rs - Fixed 2 tests to call actual code

Signed-off-by: Bailey Hayes <bailey@cosmonic.com>
@ricochet ricochet requested a review from a team as a code owner January 27, 2026 19:39
@lxfontes lxfontes added this pull request to the merge queue Jan 27, 2026
Merged via the queue into main with commit 5b2f329 Jan 27, 2026
16 of 17 checks passed
@lxfontes lxfontes deleted the test-improvements branch January 27, 2026 21:14
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