This is an archive of the discontinued Mercurial Phabricator instance.

test: extract some generic data and utility from test-rust-ancestor.py
ClosedPublic

Authored by marmoute on Dec 13 2019, 3:11 PM.

Details

Summary

We will reuse this for more tests related to revlog index. In pratice this
series of changesets add an index implementation provided from Rust and we want
to be able to test it.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

marmoute created this revision.Dec 13 2019, 3:11 PM
pulkit added a subscriber: pulkit.Dec 17 2019, 6:56 AM
pulkit added inline comments.
mercurial/testing/revlog.py
35

this and next message requires an oxford comma to help understand better.

tests/test-rust-ancestor.py
33–34

this is the next one.

marmoute added inline comments.Dec 17 2019, 7:59 AM
mercurial/testing/revlog.py
35

Can you clarify where you want a comma added ?

martinvonz added inline comments.
mercurial/testing/revlog.py
35

"C", "Extension", "parsers", "module", and maybe also "tests" are all nouns and I had trouble figuring out if any of them were used as verbs here (maybe "parsers" should be "parses", I speculated). I think this is much clearer (assuming it's still accurate):

The C version of the "parsers" module is not available. It is needed for this test.

tests/test-rust-ancestor.py
33–34

The Rust version of the "ancestor" module is not available. It is needed for this test.

33–36

The Rust or C version of the "parsers" module, which the "ancestor" module relies on, is not available.

marmoute updated this revision to Diff 18863.Dec 18 2019, 5:05 AM
pulkit accepted this revision.Dec 19 2019, 12:21 PM
This revision is now accepted and ready to land.Dec 19 2019, 12:21 PM

Amended the following in flight to make test-check-code.t happy.

diff --git a/tests/test-rust-ancestor.py b/tests/test-rust-ancestor.py
--- a/tests/test-rust-ancestor.py
+++ b/tests/test-rust-ancestor.py
@@ -33,12 +33,12 @@ except ImportError:
 @unittest.skipIf(
     rustext is None,
     'The Rust version of the "ancestor" module is not available. It is needed'
-    'for this test.',
+    ' for this test.',
 )
 @unittest.skipIf(
     rustext is None,
     'The Rust or C version of the "parsers" module, which the "ancestor" module'
-    'relies on, is not available.',
+    ' relies on, is not available.',
 )
 class rustancestorstest(revlogtesting.RevlogBasedTestBase):
     """Test the correctness of binding to Rust code.