Closed
Bug 1054517
Opened 11 years ago
Closed 11 years ago
Port Mercurial commit message hook tests to .t test
Categories
(Developer Services :: Mercurial: hg.mozilla.org, defect)
Developer Services
Mercurial: hg.mozilla.org
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: gps, Assigned: gps, Mentored)
References
Details
Attachments
(5 files)
6.51 KB,
patch
|
emorley
:
review+
|
Details | Diff | Splinter Review |
19.57 KB,
patch
|
emorley
:
review+
|
Details | Diff | Splinter Review |
13.31 KB,
patch
|
emorley
:
review+
|
Details | Diff | Splinter Review |
17.90 KB,
patch
|
emorley
:
review+
|
Details | Diff | Splinter Review |
5.36 KB,
patch
|
emorley
:
review+
|
Details | Diff | Splinter Review |
We are in the process of converting Mercurial tests in https://hg.mozilla.org/hgcustom/version-control-tools/ to the Mercurial .t test format. Details of that format at http://mercurial.selenic.com/wiki/WritingTests#Writing_a_shell_script_test.
In this mentored bug, you will take the tests for the commit message hook (https://hg.mozilla.org/hgcustom/version-control-tools/file/6f1da8433d97/hghooks/runtests.py#l402) and port them to a .t test.
You can find existing hooks .t tests in https://hg.mozilla.org/hgcustom/version-control-tools/file/6f1da8433d97/hghooks/tests.
An example conversion is https://hg.mozilla.org/hgcustom/version-control-tools/rev/42b4b8f97dfa.
Assignee | ||
Comment 1•11 years ago
|
||
I finished this on a plane over the weekend. Patches forthcoming.
Assignee: nobody → gps
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #8478340 -
Flags: review?(emorley)
Assignee | ||
Comment 3•11 years ago
|
||
During the port, it was realized that the testing methodology in
runtests.py was flawed. Since commits were being stacked, the old
testing code only verified that any commit was bad, not necessarily
that the top commit was bad. This revealed that the hook was examining
the full commit message for bug and backout syntax, as opposed to only
the first line. The hook has been updated to make the tests pass.
Attachment #8478342 -
Flags: review?(emorley)
Assignee | ||
Comment 4•11 years ago
|
||
Porting to a .t test required a custom Mercurial extension that
intercepts urllib requests. It has been implemented as part of
this patch. It isn't fully functional, but it mimics the old
testing code and it gets the job done.
Attachment #8478344 -
Flags: review?(emorley)
Assignee | ||
Comment 5•11 years ago
|
||
Reviewer note: you may want to look at the previous treeclosure patch
to validate some of the approach.
Attachment #8478345 -
Flags: review?(bugspam.Callek)
Assignee | ||
Comment 6•11 years ago
|
||
All tests in hghooks have been converted to .t tests. We can now remove
hghooks/runtests.py and its integration with run-mercurial-tests.py.
Attachment #8478346 -
Flags: review?(emorley)
Comment 7•11 years ago
|
||
Comment on attachment 8478345 [details] [diff] [review]
Port treeclosure-comm-central tests to .t format
I'm not sure if I can get to this within the next week or 2, but if ed wants to review this in my stead, I am happy to accept his review.
Attachment #8478345 -
Flags: review?(emorley)
Updated•11 years ago
|
Attachment #8478340 -
Flags: review?(emorley) → review+
Comment 8•11 years ago
|
||
Comment on attachment 8478342 [details] [diff] [review]
Port commit-messages hook tests to .t tests
Review of attachment 8478342 [details] [diff] [review]:
-----------------------------------------------------------------
Thank you - this fixes bug 1053177 for me :-)
Attachment #8478342 -
Flags: review?(emorley) → review+
Updated•11 years ago
|
Attachment #8478344 -
Flags: review?(emorley) → review+
Updated•11 years ago
|
Attachment #8478345 -
Flags: review?(emorley) → review+
Comment 9•11 years ago
|
||
Comment on attachment 8478346 [details] [diff] [review]
Remove empty hghooks test harness
Review of attachment 8478346 [details] [diff] [review]:
-----------------------------------------------------------------
::: run-mercurial-tests.py
@@ -161,5 @@
> -
> - # TODO hook up to unittest directly and share TestSuite and TestResult
> - # with Mercurial.
> - args = [sys.executable, os.path.join(HERE, 'hghooks', 'runtests.py')]
> - res2 = subprocess.call(args, cwd=os.path.join(HERE, 'hghooks'), env=env)
This was the last use of subprocess, the import can be removed now.
Attachment #8478346 -
Flags: review?(emorley) → review+
Assignee | ||
Comment 11•11 years ago
|
||
Comment on attachment 8478345 [details] [diff] [review]
Port treeclosure-comm-central tests to .t format
Callek deferred review to edmorley.
Attachment #8478345 -
Flags: review?(bugspam.Callek)
Assignee | ||
Comment 12•11 years ago
|
||
https://hg.mozilla.org/hgcustom/version-control-tools/rev/84358290af8a
https://hg.mozilla.org/hgcustom/version-control-tools/rev/c25d0b056d19
https://hg.mozilla.org/hgcustom/version-control-tools/rev/2cff974474b7
https://hg.mozilla.org/hgcustom/version-control-tools/rev/7ca809dc0f15
https://hg.mozilla.org/hgcustom/version-control-tools/rev/6d6cc743a5af
Assignee | ||
Comment 13•11 years ago
|
||
I removed the subprocess import from run-mercurial-tests.py.
Thanks for the speedy review!
Good riddance to the old tests and the test spam from runtests.py.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Product: Release Engineering → Developer Services
You need to log in
before you can comment on or make changes to this bug.
Description
•