docs: clarify Maven test invocation for ScalaTest suites#4238
Open
andygrove wants to merge 4 commits intoapache:mainfrom
Open
docs: clarify Maven test invocation for ScalaTest suites#4238andygrove wants to merge 4 commits intoapache:mainfrom
andygrove wants to merge 4 commits intoapache:mainfrom
Conversation
Strengthen the existing pitfall on `-pl spark` by explaining both failure modes: stale `~/.m2` resolution and cross-worktree corruption under concurrent builds. Replace the prior `-DwildcardSuites=...` recommendation with the correct single-suite invocation (`-Dsuites=` plus `-Dtest=none`) and call out the `-DwildcardSuites=""` pitfall, where an empty pattern silently expands to "match every suite" and overrides `-Dsuites=`.
Add a pitfall callout explaining that a bare newline ends a shell command, so copy-pasting a multi-line `./mvnw test -Dtest=none ...` without trailing backslashes silently runs only `./mvnw test -Dtest=none` (which runs every ScalaTest suite in the module). Show the same command on one line and with explicit line continuations.
Scalastyle runs on every `mvn test` invocation and rescans the whole module. Document the skip flag for local iteration; CI still enforces the check.
Contributor
|
Can we add the pitfall that if you get the suite matching/test wildcards wrong, maven will still happily run and probably give you an exit code 0 (which is what most agents cue off of), so you should double check that the tests you want actually ran? |
Member
Author
Added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Rationale for this change
The contributor guide's "Common Build and Test Pitfalls" section currently recommends
-DwildcardSuites=...for running specific tests. In practice this leads to tworecurring foot-guns:
document (
-Dsuites=with-Dtest=none), so contributors copy the wrong pattern../mvnw test -Dsuites="..." -DwildcardSuites="", silently runsevery suite in the project (the empty string is a substring of every suite name)
and takes around an hour, instead of running the named suite.
The existing warning about
-pl sparkalso understates the problem:-plresolvessibling modules from
~/.m2/repository, which not only causes stale-code surprisesbut cross-contaminates concurrent worktrees that share the same local Maven repo.
What changes are included in this PR?
Edits to
docs/source/contributor-guide/development.md:-plpitfall to call out both stale-code andcross-worktree corruption under concurrent builds.
wildcardSuites" subsection with a "Running aSpecific ScalaTest Suite" subsection that documents the correct minimal
invocation, explains why
-Dtest=noneis required, and adds an explicitcallout for the
-DwildcardSuites=""pitfall.pitfall callout so the two places stay in sync.
How are these changes tested?
Documentation-only change, no test changes required.