This is an archive of the discontinued Mercurial Phabricator instance.

tests: conditionalize tests based on presence of custom extensions
ClosedPublic

Authored by indygreg on Apr 3 2018, 1:53 PM.

Details

Summary

The test harness supports injecting extensions via --extra-config-opt.
However, if you do this, various tests that print state about loaded
extensions fail.

This commit teaches the test harness to recognize when custom
extensions are loaded so that tests can use feature sniffing to
conditionalize tests based on that.

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

indygreg created this revision.Apr 3 2018, 1:53 PM
indygreg updated this revision to Diff 7597.Apr 3 2018, 9:55 PM
durin42 added a subscriber: durin42.Apr 4 2018, 2:08 PM

Could this be more tightly integrated with --extra-config-opt?

Could this be more tightly integrated with --extra-config-opt?

What do you mean by that?

Could this be more tightly integrated with --extra-config-opt?

What do you mean by that?

Broadly, I'm wondering why we're adding support for an environment variable that's duplicating the functionality of --extra-config-opt, when the latter can already be used for this, and maybe we could get the test runner to read the --extra-config-opts and expose those somehow to hghave. Does that make sense? Am I talking crazy?

Could this be more tightly integrated with --extra-config-opt?

What do you mean by that?

Broadly, I'm wondering why we're adding support for an environment variable that's duplicating the functionality of --extra-config-opt, when the latter can already be used for this, and maybe we could get the test runner to read the --extra-config-opts and expose those somehow to hghave. Does that make sense? Am I talking crazy?

So you are advocating for a more generic solution? This patch already exposes the list of extensions as an environment variable. So you want the list of extra options to be exposed instead?

One reason I didn't do that is complexity: I don't want to have to parse config options from bash. It was easier to just set the list of extensions.

durin42 added inline comments.Apr 4 2018, 4:16 PM
tests/run-tests.py
1075

Soooooooo I'm dumb and misread this the last couple of times. Should this be doing

if section != 'extensions':

continue?

Other than that this is what I was proposing, and I'm not sure how I misread it so badly before. :(

indygreg updated this revision to Diff 7643.Apr 4 2018, 4:22 PM
This revision was automatically updated to reflect the committed changes.