nchammas opened a new pull request, #60779:
URL: https://github.com/apache/spark/pull/60779

   ### What changes were proposed in this pull request?
   
   Move the doctests captured in `__test__` out of `dev/merge_spark_pr.py` and 
into proper unit tests under `dev/prmerge/tests/`. These tests cover the abort 
path, the title prompts, JIRA updates, and `main()`.
   
   Before a merge, `dev/merge_spark_pr.py` still runs all of its own tests and 
stops if they fail. It also correctly instructs users on how to update the 
script _and_ tests if they are stale.
   
   Committers still run `dev/merge_spark_pr.py`. The merge itself is unchanged. 
Outside the tests, the only changes to the script are how it runs them at 
startup and the update command it suggests when it's out of date.
   
   This change overlaps with #60472. Happy to help rebase whichever PR gets 
merged second.
   
   ### Why are the changes needed?
   
   `__test__` is a single, massive text blob of doctests, 1,000 lines long. 
Formatting them is brittle and failures are annoying to parse.
   
   Split out into proper unit tests, these tests are much easier to read, 
change, and maintain over time. Moreover, this is the first step towards 
breaking up the merge script into a proper library under `dev/prmerge` with 
topic-specific modules and reusable tools.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   For committers, the interface to and behavior of `dev/merge_spark_pr.py` is 
unchanged. It takes the same arguments and does the same merge.
   
   A passing startup check is still quiet. If the unit tests fail, or 
`dev/prmerge/tests/` is missing, the script prints a hint to update 
`dev/merge_spark_pr.py` and `dev/prmerge/` together.
   
   ### How was this patch tested?
   
   I ran the unit tests directly, and I ran the script so it would execute both 
the doctests and the suite before printing help. I also ran it with a failing 
test and with `dev/prmerge/` removed. Both stopped before the merge and printed 
the update hint.
   
   ```sh
   python3 -m unittest discover -s dev/prmerge/tests -t dev
   python3 dev/merge_spark_pr.py --help
   ```
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor Grok 4.7
   Generated-by: Cursor Claude Opus 5.5
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to