Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Improving flexibility of dev and testing environments in version-control-tools

7 views
Skip to first unread message

Gregory Szorc

unread,
May 5, 2017, 4:37:51 PM5/5/17
to Gregory Szorc, dev-version-control
On Wed, Apr 19, 2017 at 11:59 AM, Gregory Szorc <g...@mozilla.com> wrote:

> The unified development/testing environment in version-control-tools was a
> good idea when it was created. But it has outgrown its modest origins,
> downloading dozens of Python packages, building a handful of slow-to-build
> Docker images, and even compiling Git from source.
>
> Many have complained that setting up the environment for e.g. hacking on
> Mercurial hooks and extensions was just too difficult. And, the complexity
> of all this was one of the reasons that drove Conduit to not exist in
> version-control-tools.
>
> I want hacking on tools to be approachable and turn key: anyone should be
> able to easily scratch an itch. It was clear the monolithic dev/test
> environment in version-control-tools had grown into something that was
> infringing on that goal.
>
> As of a few minutes ago, version-control-tools now supports multiple dev
> and test environments. For example:
>
> $ ./create-environment vcssync # takes ~20s instead of 20+ minutes
> (mainly because no Docker)
> $ source venv/vcssync/bin/activate
> $ ./run-tests # only runs tests relevant to this environment
>
> Currently, the only sub-environment supported is for hacking on the
> version control syncing code (currently used for importing Servo into
> mozilla-central). But I'd like to add environments to facilitate rapid
> hacking on Mercurial extensions and hooks, and any other sub-projects in
> the repo. I'm not sure what the timetable will be. But if you ping me and
> say having this would make your life easier, I can prioritize the work and
> try to get you something in <48 hours. Or you can follow the breadcrumbs at
> https://hg.mozilla.org/hgcustom/version-control-tools/rev/c55c7c8a5fb1
> and just submit a patch for review :)
>

As of a few minutes ago, there is now an "hgdev" environment that supports
hacking on the Mercurial hooks and most extensions. It is pretty painless
to use:

# Takes ~60s.
$ ./create-environment hgdev
$ source venv/hgdev/bin/activate
# Takes ~35s.
$ ./run-tests -j8

Or to test hooks for hg.mozilla.org:

# Takes ~8s.
$ ./run-tests -j8 hghooks

It does not (yet) support Docker. That means no support for MozReview,
vcsreplicator, hg.mo service testing, and some random tests that touch
Bugzilla APIs (such as bzexport). If you attempt to run these tests,
they'll be skipped with e.g. "missing feature: Require mozreview Docker
pieces."

I hope this nullifies most complaints about testing complexity from casual
contributors to the common Mercurial extensions and hooks.

Byron Jones

unread,
May 7, 2017, 11:16:51 PM5/7/17
to dev-version-control
Gregory Szorc wrote:
> As of a few minutes ago, there is now an "hgdev" environment that supports
> hacking on the Mercurial hooks and most extensions.
this is awesome; thanks for working on that gps.


--
glob — engineering productivity — moz://a

0 new messages