Commit Graph
117 Commits
Author SHA1 Message Date
bflatastic 780bfa081e Merge remote-tracking branch 'origin/main' into fix-1428
# Conflicts:
#	crates/testkit/Cargo.toml
2026-11-30 01:48:36 +07:00
bflatastic de4d130319 Merge remote-tracking branch 'origin/main' into fix-1392
# Conflicts:
#	crates/testkit/README.md
2026-11-30 01:12:49 +07:00
dotCooCoo ae7fcffdb9 testkit: README counts the eight proptest-regressions files on main 2026-11-29 00:54:26 -08:00
dotCooCoo c416e3785c testkit: README says prop::config rejects a zero case count 2026-11-29 00:52:46 -08:00
dotCooCoo c630b26120 Merge main into feat/craft-testkit-temp 2026-11-28 15:17:39 -08:00
dotCooCoo 5209d1817e testkit: reject an unknown PROPTEST_RNG_ALGORITHM in prop::config
For a value it does not know, proptest prints a warning and falls back
to ChaCha, so a reproduction run with a misspelled algorithm used a
different generator and could pass. `config` now parses the variable
itself: `xs`, `cc` and `rc` select their generators, `pt` and any other
value make it panic, and an unset variable keeps the generator from
`Config::default()`.
2026-11-28 15:03:52 -08:00
dotCooCoo 1f6d8b2479 Merge main into feat/craft-testkit-prop 2026-11-28 14:47:48 -08:00
dotCooCoo 05824ee3ca Merge main into feat/craft-testkit-log 2026-11-28 13:19:31 -08:00
dotCooCoo f73c161182 Merge main into feat/craft-testkit-prop 2026-11-28 13:19:31 -08:00
dotCooCoo 4e2a9f0ab0 Testkit: harden TempDir against a moved root, owner-unusable modes and bad names
`TempDir::new_in` passed the root to `tempfile` as given, so when the root was
reached through a link that changed during the test, `path()` named the old
folder while drop and `close()` resolved the link again: the folder that was
made stayed and a folder with the same name under the new target could be
removed. The root is now canonicalized before the folder is made, and the
symlink-root test retargets the link before the drop.

On Unix a umask that removes owner read, write or search permission left the
new folder unusable (for example mode 0o300) while `TempDir::new` returned
Ok, since the owner probe needs only write and search; cleanup then failed.
`check` now returns PermissionDenied unless the owner has all three, before
the probe runs.

`TempDir::new` and `TempDir::file` also return InvalidInput for `<`, `>`,
`"`, `|`, `?`, `*` and control characters, which Windows does not allow in a
file name, on every platform. The README and doc comments list them.
2026-11-28 09:42:49 -08:00
dotCooCoo b88a240d26 Merge main into feat/craft-testkit-temp 2026-11-28 09:10:20 -08:00
dotCooCoo e6ae4b0088 Merge main into feat/craft-testkit-image 2026-11-28 08:54:41 -08:00
dotCooCoo c32bb21596 testkit: reject PROPTEST_RNG_ALGORITHM=pt in prop::config
The pass-through generator reads caller-supplied bytes instead of a u64
seed, so a runner built from `config` with `PROPTEST_RNG_ALGORITHM=pt`
panicked inside proptest with a message that did not name the variable.
`config` now panics with a message naming `PROPTEST_RNG_ALGORITHM`.

New child-process tests cover the rejected `pt` value and check that the
XorShift generator (`xs`) is kept with the pinned seed and repeats its draws.
2026-11-28 08:09:01 -08:00
dotCooCoo f2eeae73dd testkit: require proptest 1.7 and document PROPTEST_RNG_ALGORITHM
`prop::config` uses `Config::rng_seed` and `RngSeed`, which proptest added
in 1.7, so the workspace requirement moves from "1" to "1.7". The locked
1.12.0 already satisfies it.

The README now says that `config` keeps the generator chosen by
`PROPTEST_RNG_ALGORITHM`, and that repeating a failing run needs the same
algorithm and other `PROPTEST_*` settings as well as the seed and count.
2026-11-28 07:58:58 -08:00
dotCooCoo 717ccdec66 Testkit: require tempfile 3.20 and qualify the temp docs
temp.rs calls TempDir::disable_cleanup, which tempfile 3.20.0 added, so
the dependency now asks for 3.20. The crate docs no longer link
temp::TempDir, which is not built for wasm32, and say the folder is
private on Unix and that removal on drop is best effort. The READMEs say
the same, that the umask can remove more bits from the requested 0o700,
and that the Unix check reads mode bits only, not access control lists.
2026-11-28 05:55:03 -08:00
dotCooCoo 1f31eede1c testkit: define the function the capture example calls
The README's process-wide capture example called drop_the_plugin
without defining it, so a copied test did not compile. The example now
defines it as a function that logs a warning containing the text the
assertion looks for.
2026-11-28 05:49:15 -08:00
dotCooCoo 876cb5b12f Merge main into feat/craft-testkit-prop 2026-11-28 05:41:17 -08:00
dotCooCoo ca9f44cb0c Merge main into feat/craft-testkit-fixtures 2026-11-28 05:22:27 -08:00
dotCooCoo a1aa06347d Merge main into feat/craft-testkit-image 2026-11-28 05:17:37 -08:00
dotCooCoo 16de9b20b0 Merge main into feat/craft-testkit-temp 2026-11-28 05:17:37 -08:00
dotCooCoo b5b5ca3fb6 Merge main into feat/craft-testkit-log 2026-11-28 05:17:37 -08:00
BFlat f83e228e81 Merge pull request #1459 from dotCooCoo/feat/craft-testkit-mcp
craft-testkit: add the mcp feature, an MCP stdio test client with deadlines and line limits
2026-11-28 17:51:42 +07:00
BFlat f7e0ec5f4a Merge pull request #3942 from dotCooCoo/fix/testkit-deadline-hang-guard
craft-testkit: deadline limits only catch hangs; wait_until waits on a Signal
2026-11-28 17:51:19 +07:00
dotCooCoo 4521300930 Merge main into feat/craft-testkit-temp 2026-11-28 02:21:36 -08:00
dotCooCoo aa95babe21 Testkit: fixtures skip or fail through craft_testkit::skip
generate and generate_with no longer keep their own required variable
and skip_or_fail. A fixture that cannot be made now goes through
skip::skip with the variable generate is given (default
CRAFT_TEST_REQUIRED): unset or empty prints `SKIPPED: <reason>`, `1`
fails the test, and any other value, `0` included, fails it as a
configuration error. generate_with keeps the caller's required value
and prints the same skip line. The README paragraph and the test of the
variable's values follow the new rule.
2026-11-28 02:21:04 -08:00
dotCooCoo 235fe4146a Merge main into feat/craft-testkit-log 2026-11-28 02:19:46 -08:00
dotCooCoo 3b82e85521 Merge main into feat/craft-testkit-prop 2026-11-28 02:16:47 -08:00
dotCooCoo 68ab810760 Merge main into feat/craft-testkit-mcp 2026-11-28 02:16:39 -08:00
dotCooCoo f41b28a53c craft-testkit: wait_until's limit counts from the start of the call
The limit restarted after every call of the condition, so a thread that
kept raising the signal while the condition stayed false held wait_until
forever. The limit now counts from the start of the call, and each wait
lasts at most the time left. The condition is still called before the
limit is checked, so a condition that holds never fails.

Two tests cover it: an injected clock with a wait that always reports a
raise, and a real thread raising in a loop under with_deadline. Both
fail without the change.
2026-11-28 02:15:25 -08:00
dotCooCoo dab898760e Merge main into feat/craft-testkit-fixtures
# Conflicts:
#	Cargo.lock
#	README.md
#	crates/testkit/README.md
2026-11-28 02:09:48 -08:00
dotCooCoo 0cc7c2d8f9 Merge main into fix/testkit-deadline-hang-guard 2026-11-28 01:51:38 -08:00
dotCooCoo 361a035e08 Merge main into feat/craft-testkit-fonts 2026-11-28 01:39:11 -08:00
dotCooCoo 19c3356e78 craft-testkit: deadline limits only catch hangs; wait_until waits on a Signal
with_deadline failed a body that returned or panicked after its limit, and
hammer failed a case that finished after its per-case limit, so a slow
runner could fail a test whose code was correct. Both now take whatever the
body or case produced, however late it arrives, and fail on the limit only
when nothing has arrived by then.

wait_until polled its condition with sleeps against a clock and failed a
true that came after the limit. It now takes a Signal: the condition is
called at once and again each time another thread calls Signal::raise, and
the limit only fails a wait that saw no raise in that time. A raise made
while the condition runs is not lost. No crate in this workspace calls
wait_until.

The tests use an injected wait for the limit and an injected clock instead
of real 50 ms limits, and new tests cover a value or panic that arrives
after the limit, a case that finishes after its limit, and a raise during
the condition. The tests of the removed behavior (a late result fails, the
pause schedule of the polling loop) are replaced by these.
2026-11-27 14:48:11 -08:00
dotCooCoo 565513eab9 Validate MCP tool results and drain output during shutdown 2026-11-26 16:57:19 -08:00
dotCooCoo 48b9770c15 testkit: bound retained notification bytes 2026-11-26 15:41:25 -08:00
dotCooCoo 284c3a9941 testkit: document initialization and failure cleanup 2026-11-26 15:26:09 -08:00
dotCooCoo ce2f746e4c testkit: validate MCP replies and stop failed queued writes 2026-11-26 15:22:47 -08:00
dotCooCoo 4bdac469e1 craft-testkit: fail pinned on a folder variable name that cannot be read
pinned now fails the test when the folder variable name is empty or
holds `=` or a NUL character, before the environment is read, instead
of reading it as unset and skipping. The docs of verify and the README
also state what the containment check after the open covers on each
platform, that an Apple path query error fails verification, and that
the manifest parser does not check names against a file system's rules.
2026-11-25 22:14:02 -08:00
dotCooCoo 0c80737af7 Merge feat/craft-testkit-skip into feat/craft-testkit-corpus
# Conflicts:
#	Cargo.lock
#	README.md
#	crates/testkit/Cargo.toml
#	crates/testkit/README.md
#	crates/testkit/src/lib.rs
2026-11-25 21:10:10 -08:00
dotCooCoo 763953331a craft-testkit: say what access a Windows TempDir gets
On Windows the folder gets the inheritable access entries of the
temporary directory and is not checked. The module docs and README now
say so, and that a TMP or TEMP naming a shared folder may let other
users open it.
2026-11-25 20:45:49 -08:00
dotCooCoo 52ce378f83 Merge main into feat/craft-testkit-image 2026-11-25 20:40:56 -08:00
dotCooCoo fbd4c09443 Merge main into feat/craft-testkit-temp 2026-11-25 20:36:08 -08:00
dotCooCoo 6db18d9089 craft-testkit: connect and close docs say when the MCP reading thread stops 2026-11-25 20:13:19 -08:00
dotCooCoo 3a4427a57f craft-testkit: close waits for the rest of the MCP child's stderr after it exits
close waited for the stderr thread only as long as close_grace, so with a
short or zero grace the bytes still in the pipe when the child exited could
be missing from CloseOutcome::stderr. It now waits up to 5 s after the child
exits, and only a process that keeps the child's stderr open waits that long.
2026-11-25 20:07:39 -08:00
dotCooCoo 92d264e811 Merge main into feat/craft-testkit-log 2026-11-25 19:57:06 -08:00
dotCooCoo 20f1cddbc9 Merge main into feat/craft-testkit-mcp 2026-11-25 19:54:43 -08:00
dotCooCoo bb9472cff4 Merge main into feat/craft-testkit-prop 2026-11-25 19:48:52 -08:00
dotCooCoo 3814174538 craft-testkit: take skrifa from the workspace, behind the font-coverage feature
skip::craft_fonts_cover and its tests need the new font-coverage feature,
so a crate that dev-depends on craft-testkit no longer builds skrifa
unless it asks for the feature. skrifa comes from the workspace
dependency. skip::required is the one parser for a required variable:
unset or empty is optional, 1 is required, and every other value is a
configuration error.
2026-11-25 19:32:15 -08:00
dotCooCoo 926191f175 Merge main into feat/craft-testkit-skip 2026-11-25 19:30:20 -08:00
dotCooCoo 216dd09cd4 Merge main into feat/craft-testkit-fixtures 2026-11-25 19:26:51 -08:00