( )⚙ D3030 tests: conditionalize tests based on presence of revlogs for files

This is an archive of the discontinued Mercurial Phabricator instance.

tests: conditionalize tests based on presence of revlogs for files
ClosedPublic

Authored by indygreg on Apr 2 2018, 11:53 PM.

Details

Summary

~85 tests don't like our non-revlog file store for various reasons.

This commit introduces hghave functionality for declaring and querying
repository features. By default, we assume repositories have
revlog-based file storage. But if the HGREPOFEATURES environment
variable is set, we can override the default set of repository
features. If you run the test harness with our simplestorerepo
extension and an environment variable set to the proper value, you
can override the hghave defaults to agree with simplestorerepo's
version of reality.

Various tests have been modified so behavior dependent on revlog-based
file storage is marked as such.

This fixes a handful of test failures with our custom file storage
extension. But dozens remain. The point of this commit is to demonstrate
how tests will need to be modified to account for custom storage
implementations.

TBH, I'm not convinced hghave is the proper layer for repository
feature detection. I /think/ we'll eventually want something in
run-tests.py itself. But that would require inventing a new primitive
in the test harness. This is all very alpha at the moment. So I think
hghave is an acceptable place to hang this feature detection. I think
the right time to be thinking about integrating this into run-tests.py
is *after* we have a stable alternate storage implementation in core.
For now, let's try to make progress towards the idea of an alternate
storage backend.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Apr 2 2018, 11:53 PM
indygreg planned changes to this revision.Apr 3 2018, 5:19 PM

After porting several more tests, I plan to make some tweaks to this.

indygreg updated this revision to Diff 7596.Apr 3 2018, 9:55 PM
durin42 accepted this revision.Apr 4 2018, 2:04 PM
durin42 added a subscriber: durin42.

Seems fine for now, we may need to revisit it later if we get too many stores.

This revision is now accepted and ready to land.Apr 4 2018, 2:04 PM
This revision was automatically updated to reflect the committed changes.