This repository was archived by the owner on Jul 22, 2026. It is now read-only.
Extract shared test helpers, simplify integration tests - #1
Merged
Conversation
Code reuse: - New tests/test_util.ml hosts contains, must_contain, must_omit. - Removed the verbatim-duplicated contains from 7 test files and must_contain/must_omit from 2 of them. Each file now opens Test_util; call sites are unchanged. Quality (test_kitchen_sink.ml): - Trimmed meta-narrative header, deleted WHAT/banner comments. - Replaced ad-hoc tuple destructure repeats with a small omit_in_stdout helper backed by must_omit. - Renamed scenario-local shadowed `let r` to named bindings. - flag_count_count -> flag_count; dropped stale /etc/hosts comment. Efficiency: - test_kitchen_sink.ml `run`: switched from manual create_process_env + pipes + waitpid to open_process_args_full + close_process_full (33 -> 22 lines, same behavior). - test_mamba.ml test_man_write_all: Filename.temp_file + remove + mkdir collapsed to Filename.temp_dir; dropped Sys.file_exists TOCTOU check; (Unix.stat p).st_size replaces open_in + in_channel_length + close_in. CI: - Dropped the single-row matrix scaffold; setup-ocaml@v3 handles caching automatically. All 302 tests pass. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
contains/must_contain/must_omitintotests/test_util.ml; remove the 7 verbatim copies.tests/test_kitchen_sink.ml: trim narrative header, delete WHAT-comments, name shadowed scenario locals, replace ad-hoc tuple destructures with a smallomit_in_stdouthelper.runnow usesUnix.open_process_args_full+Unix.close_process_full(33 → 22 lines, same behavior);test_man_write_allusesFilename.temp_dirand(Unix.stat p).st_sizeinstead of the file-then-mkdir dance andopen_in/in_channel_length/close_in..github/workflows/ci.yml: drop the single-row matrix scaffold.Net: +106 / −214 lines.
Test plan
dune buildclean, zero warningsdune runtestgreen — 302 tests across 10 suites🤖 Generated with Claude Code