Skip to content

microskills: read bin/rails test as a test run - #377

Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix-microskills-rails-test
Open

Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix-microskills-rails-test

Conversation

@Shizoqua

Copy link
Copy Markdown
Contributor

The observer did not observe bin/rails test at all, while the loop guard counts rails test as a test run (since #209). Rails runs a project's tests with bin/rails test [PATHS...], and one folder's with bin/rails test:system, test:all and the rest, so a Rails app's test runs taught the micro-skills nothing, though their minitest summaries already read as tests that ran. In an app where rails is not on PATH and bin/rails test passes, the FormRepair fact naming bin/rails test was never learned.

Fix: in the generic reading, rails test and rails test:<folder> are a test run with the form as it was called (bin/rails test, rails test, bundle exec rails test, bin/rails test:system), the path kept as for other runners, since rails and bin/rails are different ways to run it. The other Rails commands (server, db:migrate, generate, console) are not observed, as before, and the Python vocabulary is unchanged. Over the 5,974 strings in the test suites, only the two rails test commands in the loop guard's own tests are classified differently, each now as a test run.

Tests, in a new tests/test_observe_rails_test.py:

  • bin/rails test, rails test, with paths, test:system, test:all, behind bundle exec, a RAILS_ENV=test or a cd, is a test run with its form, as the loop guard reads it (fail on main);
  • the other Rails commands are not, in either reading, and the Python vocabulary does not read Ruby;
  • a passing run shows its form works (fails on main);
  • end to end, four sessions where rails is not on PATH and bin/rails test passes teach the fact that names bin/rails test (fails on main).
python -m pytest tests -n 4 --dist worksteal -rfEs --tb=line
1929 passed, 41 skipped

The skips need Windows, a real agent CLI (Codex, Hermes, opencode) or aider, or a non-root user.

Fixes #376

Rails runs a project's tests with bin/rails test, and one folder's with test:system, test:all
and the rest. The loop guard counts rails test as a test run, but the observer did not observe
it at all, so a Rails session's test runs taught nothing. It is now a test run in the generic
reading, with the form as it was called (bin/rails test, rails test, bundle exec rails test).
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.

microskills: bin/rails test is not observed as a test run

1 participant