Skip to content

microskills: read a Maven or Gradle test run with other goals or options first - #384

Open
Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix-microskills-maven-gradle-tasks
Open

Lanre Shittu (Shizoqua) wants to merge 1 commit into
microsoft:mainfrom
Shizoqua:fix-microskills-maven-gradle-tasks

Conversation

@Shizoqua

Copy link
Copy Markdown
Contributor

The observer read a Maven or Gradle test run only when test was the first word after the tool. Agents usually put options or other goals first, so mvn -q test and mvn clean test read as a call to the package tool mvn, ./gradlew clean test and ./gradlew --offline test were not observed at all, and ./mvnw test was not observed. The loop guard counts all of them as test runs, so their runs never showed the micro-skills that their form works. The other way round, mvn test -DskipTests read as a test run though Maven runs none.

Fix: in the generic reading, a Maven run (mvn, mvnw) with a test goal among its others, and a Gradle run (gradle, gradlew) with a test task among its others, a subproject's :core:test included, is a test run with the form mvn test, mvnw test, gradle test or gradlew test (the base name, as ./gradlew test already was). Not a Maven run told to skip the tests (-DskipTests, -D skipTests, --define=skipTests, maven.test.skip, unless =false), which reads as a call to mvn as mvn clean test -DskipTests already did, and not a Gradle run whose test task -x/--exclude-task leaves out. This is the loop guard's own reading (loopguard.turn.VERIFY_RE). Over the 5,974 strings in the test suites, only the Maven and Gradle commands in the loop guard's own tests (tests/test_loopguard_jvm_builds.py) are classified differently, each now as the loop guard reads it, and that file's docstring, which quotes ./gradlew :app:test.

Tests, in a new tests/test_observe_maven_gradle_tasks.py:

  • a test goal or task after options or other goals, through a wrapper or for a subproject, is a test run with its form (fail on main);
  • a Maven run that skips the tests and a Gradle run that leaves the test task out are not (mvn test -DskipTests fails on main);
  • the observer and the loop guard agree on every one of these (fail on main);
  • mvn test, ./gradlew test, mvn clean install, mvn verify and ./gradlew build -x test read as before, and the Python vocabulary does not read Maven;
  • a passing mvn -q clean test shows the tests ran and its form works (fails on main).
python -m pytest tests -n 4 --dist worksteal -rfEs --tb=line
1965 passed, 41 skipped

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

Fixes #383

…ons first

The observer read mvn test and ./gradlew test as test runs only when test came first, so mvn -q
test, mvn clean test, ./gradlew clean test and ./gradlew --offline test read as a call to the
package tool or were not observed, and ./mvnw test was not observed. The loop guard counts all
of them. A test goal or task anywhere among the others, a subproject's :core:test included, is
now a test run, except a Maven run told to skip the tests (-DskipTests, maven.test.skip) or a
Gradle run that leaves the test task out (-x test), as the loop guard reads them.
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: a Maven or Gradle test run with options or other goals before test is not observed as one

1 participant