Stop Minitest/NoTestCases from flagging the ExecutableLoadedInTest cop class; add lessons for three Minitest cops #1445
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1445
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Minitest/NoTestCasesreports the cop classRuboCop::Cop::Sdlc::Structural::ExecutableLoadedInTestas a test class with no tests. The class is a cop, not a test. The offense stays in the os-sdlc batch phase, sobin/lint-worklist --target os-sdlcnever prints "Worklist clear". Three cops in the same batch also have no lint lesson:Minitest/NoTestCases,Minitest/NoAssertions,Minitest/MultipleAssertions. #1440 covers theMetrics/MethodLengthlesson.Observed
After the fix-lints unit merged (main
5ddde177), the only os-sdlc offense left is this one.rubocop-minitest treats a class as a test class when it has a superclass and its name ends in
Test.ExecutableLoadedInTest < RuboCop::Cop::Basematches that rule.Reproduce
Approach
Needs a ruling. Option A: rename the cop class so its name does not end in
Test. This changes the public cop nameSdlc/Structural/ExecutableLoadedInTestthat.rubocop.ymlfiles and the lesson reference. Option B: change howMinitest/*cops select files (for example, run them only on test paths) in the gate config. The fix-lints unit was not permitted to change a cop name or the config, so it left the offense.Separately, write lint lessons for
Minitest/NoTestCases,Minitest/NoAssertions,Minitest/MultipleAssertions.Origin
/os-sdlc:fix-lintson target os-sdlc, 2026-10-27Minitest/NoTestCasesmatches a cop class ← rubocop-minitest selects test classes by name suffix (UPSTREAM-TOOL: rubocop-minitesttest_class?)VERDICT: CREATE
Occurrence: Add a lint lesson for Minitest/NoAssertions
Seen: plugins/os-aidd-lint/tests/zeitwerk_eager_load_test.rb (fix-lints on os-aidd-lint, batch phase, 2026-10-27)
Run: session 9f415790-a6bd-4850-8d70-3dd45004ce2b
Adds: a live NoAssertions site. With no lesson, the agent fixed a test that only ran the Zeitwerk eager load by wrapping the load in assert_silent. The smell-analysis can use this site as its real offense.
Applied option B (gate config), as the #1337 track planned:
Minitest/NoTestCasesinplugins/os-sdlc/.rubocop.ymlnow has a cop-levelIncludeof**/test/**/*and**/tests/**/*(commit50e55c14on branch ticket-1337, merging with #1337).Cause: the rubocop-minitest department
Includehas**/*_test.rb, and the cop file nameexecutable_loaded_in_test.rbmatches it, so the cop class was judged a test class. The new copown_entry_point_spawned_in_test.rbwould have hit the same false positive.Result:
rubocop --only Minitest/NoTestCases plugins/os-sdlcreports no offenses, andbin/lint-worklist --target os-os-sdlchas no batch phase. No cop was renamed.This ticket stays open: the lessons for
Minitest/NoTestCases,Minitest/NoAssertionsandMinitest/MultipleAssertionsare still missing.Correction to the comment above: the command is
bin/lint-worklist --target os-sdlc.Ruling 2026-10-28 (Jared): B. Keep the config fix
50e55c14(Minitest/NoTestCases Include limited to test folders); do not rename ExecutableLoadedInTest. The fix covers every future cop file named *_in_test.rb. This ticket stays open only for the 3 Minitest lessons (NoTestCases, NoAssertions, MultipleAssertions), written by hand with /os-sdlc:smell-analysis.