Repository navigation
Conversation
AI Code ReviewWhat Looks GoodThis PR successfully fixes the issue where Test Coverage:
Implementation Quality:
Documentation & Process:
Robustness:
The fix addresses the exact issue described in #1363 and maintains backward compatibility (e.g., RecommendationApprove - The PR is ready to merge. It correctly fixes the reported issue with comprehensive tests, proper documentation, and follows all project practices. No changes are needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
7ea0c0b to
92d3dfd
Compare
fix(pages): address widgets inside Accordion groups; refuse dropped item properties (#891)
|
Thanks — the fix is right, and the evidence holds up: the four new tests pass, and with the old Blocker: one unreadable subfolder now makes the whole run failIn Reproduced as an unprivileged user ( No tests ran. The suite can't catch this, because CI and devcontainers run as root, and root ignores Suggested fix: fail hard only on the root, and treat an error below it as that entry's failure: The run still goes red through Worth considering
Minor
Generated by Claude Code |
ParseTestDir skipped every sub-directory, so `mxcli test tests` found nothing when suites live in tests/<Module>/*.test.mdl. It now walks the tree in lexical order, skipping hidden folders; the "no tests found" hint walks the same way. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd nothing (mendixlabs#1363) Folders starting with `_` below the folder you name are skipped, like dot-folders (the Go toolchain's rule), so a deliberate positive-control suite in tests/unit/_control stays out of the default run; naming it runs it. The skipped folders are reported on the line after "Found N test(s)" in a run and in --list, and in the "no tests found" hint, so nothing disappears silently. `mxcli test <dir> --list` over a tree with no tests now prints the reason on stderr. Its exit status stays 0; a real run with no tests already exits 1. ListTests takes a second writer for that hint. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
92d3dfd to
6383ce3
Compare
AI Code ReviewReview SummaryThis PR improves test discovery in Critical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove the PR. It fully addresses issue #1363 with thoughtful implementation, comprehensive tests, and excellent documentation. The minor error handling concern does not block merging given the existing codebase patterns and low risk. Note: The PR correctly avoids touching MDL syntax/generator files (as noted in the review guidelines) since this is purely a test discovery improvement in the CLI. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
…bs#1363) Review of mendixlabs#1368. With discovery recursive, one unreadable folder (a locked folder, a root-owned one in a mounted volume) made ParseTestDir return a hard error and dropped every test in the other folders. Only an error on the root is fatal now; below it the error is that folder's: it is added to FileErrors (Dir set), the run goes red through it, and the readable tests are kept. The messages say "could not be read" for a folder, not "failed to parse". Also: - testFilesMTime (--watch) walks with walkTestTree, so hidden and _ folders and the root rule cannot drift from discovery. - Errors, FileErrors and tests report paths under the name the user typed when the root is a symlink, not the resolved target. - Document that discovery is fully recursive (point at the tests folder, not the project root) and that symlinked subfolders are not followed. Tests inject the walk error through a seam so Windows and root CI cover the logic; the real chmod 000 test skips there. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Thanks. The blocker and every note are addressed in a third commit, Blocker: an unreadable subfolder no longer fails the run.
I didn't add a hard-coded skip list, because it could hide someone's tests. Minor:
Also: the CHANGELOG entry for #1363 is extended, and there's a new findings record. Its insight: moving from a one-level Evidence:
|
AI Code ReviewReview SummaryCritical IssuesNone found. Moderate IssuesNone found. Minor Issues
What Looks Good
RecommendationApprove. The PR fully resolves #1363 with robust, well-tested changes that align with project conventions. It enhances test discovery without breaking existing workflows and provides clear feedback to users about skipped folders and missing tests. No further changes are needed. Automated review via OpenRouter (Nemotron Super 120B) — workflow source |
Closes #1363.
What it does
testrunner.ParseTestDirwalks the folder tree (filepath.WalkDir, lexical order) through a small helper,walkTestTree, instead of reading one level and skipping directories.mxcli test testsnow runstests/<Module>/*.test.mdl..git,.mxcli, …) are skipped. The root itself is always read, somxcli test .still works. A symlinked root is resolved first, asos.ReadDireffectively did. Symlinked subfolders are not followed, which avoids cycles.FilesRead,FileErrorsand the suite name are unchanged.emptySuiteError) uses the same walk, so it still names a misnamed file in a subfolder.cmd_test_run.goand indocs-site/src/tools/{testing,running-tests}.md, plus a CHANGELOG entry (Unreleased → Fixed) and a finding infindings/cmd-mxcli/.Evidence
Test-first:
parser_dir_test.goadds 4 tests. Against the oldParseTestDir:FilesRead = 1, want 3;FilesRead = 0, want 3;All pass with the fix. The fourth test, "hidden root is still read", guards against skipping too much.
Manual, Windows 11: with
tests/Sales/math.test.mdl,mxcli test tests --listprintsFound 1 test(s)(it wasFound 0on v0.24.0).go test ./cmd/mxcli/testrunner/on Windows: the only failures are the three pre-existing handshake tests (Five tests fail on Windows (POSIX file-mode assertions + a path assumption) — never run there until now #897 family, and On Windows,mxcli test --attachrefuses a running app: the handshake liveness check usesSignal(0), which never succeeds there #1284/fix: detect a live process on Windows in the test and dev-loop handshakes (closes #1284) #1285), and none is newly failing.go vetis clean for windows, linux and darwin.Linux (
golang:1.26.6-bookworm, ANTLR 4.13.2, the same as CI):make grammar build test check-mdl check-findings check-conformance check-migration-reference lint-goall pass.No
mdl-examples/bug-testsscript, since the bug is in test-file discovery, not MDL execution.Update (rebased on v0.27.0, second commit)
A second report on #1363 asked for a positive-control folder to stay out of the default run, and for a 0-test result not to look like a pass. The second commit,
fix: mxcli test skips folders starting with _ and says why --list found nothing, adds the following.Folders starting with
_below the root are skipped, like dot-folders. This follows the Go toolchain convention. The folder you name is always read:mxcli test tests/skipstests/unit/_control/;mxcli test tests/unit/_control/runs it.Skipped
_folders are named in the output, so nothing disappears silently:The line comes after the
Found N test(s)line of a run, and at the end of a--list. Dot-folders are not reported. JUnit and JSON output are unchanged.--listwith 0 tests says why on stderr. It gives the same explanation a real run gives, plus the_folders it skipped. Its exit code stays 0, because--listis an inspection command.A real run with 0 tests still exits 1, as it has since v0.20.
ListTestsgains ahints io.Writerargument. Its one caller passesos.Stderr.Evidence:
parser_dir_test.go. Against the first commit's behaviour, 7 fail; the eighth (TestListTestsWithTestsWritesNoHint) is the control and passes both ways. All pass with the change.go vetandgofmtare clean. Acrosscmd/mxcli/testrunnerandcmd/mxcli, the failing tests on Windows are the same as onmain: the 0600-mode and handshake family.findings/cmd-mxcli/.golang:1.26.6-bookworm, ANTLR 4.13.2):make grammar build test check-mdl check-findings check-conformance check-migration-reference lint-goall pass.Real run on Windows, with suites only in
onlyctl/unit/_control/:🤖 Generated with Claude Code