Skip to content
Snippets Groups Projects
Commit 631ac2098634 authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

benchmark: migrate discovery benchmarks to roles

The existing discovery test are now using the new roles information. To keep the compatibility witht he older class structure. We are using the `benchmark_name` feature to keep the same name. We'll probably want to use the very same feature to rename all test later into something more sensible.

However, as a side effect, this means we are dropping the "same" variant of the
subset/super set test. So ASV will be confused by the params value change...
<sigh>.

Important note: for this discovery to work, benchmark now needs to be have an
upgraded reference.
parent 4998bff40454
No related branches found
No related tags found
No related merge requests found
...@@ -370,10 +370,10 @@ ...@@ -370,10 +370,10 @@
) )
class DiscoveryTimeSuite(BaseExchangeTimeSuite): class BaseDiscoveryTimeSuite(BaseExchangeTimeSuite):
# debugdiscovery does not support revset argument # debugdiscovery does not support revset argument
params = BaseTestSuite.params + [ params = BaseTestSuite.params + [
['local', 'ssh', 'http'], ['local', 'ssh', 'http'],
STRIP_VARIANTS_LIST, STRIP_VARIANTS_LIST,
[None]] [None]]
...@@ -374,9 +374,23 @@ ...@@ -374,9 +374,23 @@
# debugdiscovery does not support revset argument # debugdiscovery does not support revset argument
params = BaseTestSuite.params + [ params = BaseTestSuite.params + [
['local', 'ssh', 'http'], ['local', 'ssh', 'http'],
STRIP_VARIANTS_LIST, STRIP_VARIANTS_LIST,
[None]] [None]]
def _track_discovery(self, *args, **kwargs):
data = self.role_data.get(kwargs['strip'], {})
data = data.get(self.repo_name)
if data is None:
raise NotImplementedError("no roles data for this partials' key")
source = self.repo_path_from_id(data['source'])
target = self.repo_path_from_id(data['target'])
return self.perfext('perfdiscovery', '--repository', source, target)
@setup_role
class DiscoverySubsetTimeSuite(BaseDiscoveryTimeSuite):
role_action = 'discovery'
role_subtype = 'subset'
@params_as_kwargs @params_as_kwargs
@not_broken_hgweb @not_broken_hgweb
def track_discovery_subset(self, *args, **kwargs): def track_discovery_subset(self, *args, **kwargs):
...@@ -380,13 +394,14 @@ ...@@ -380,13 +394,14 @@
@params_as_kwargs @params_as_kwargs
@not_broken_hgweb @not_broken_hgweb
def track_discovery_subset(self, *args, **kwargs): def track_discovery_subset(self, *args, **kwargs):
"""Local repository is a subset of remote.""" return self._track_discovery(self, *args, **kwargs)
# self.hg() passes self.repo_path through --cwd, we override track_discovery_subset.benchmark_name = 'basic_commands.DiscoveryTimeSuite.track_discovery_subset'
# that with -R
return self.perfext('perfdiscovery', @setup_role
'--repository', self.clone_path, class DiscoverySupersetTimeSuite(BaseDiscoveryTimeSuite):
self.repo_path) role_action = 'discovery'
role_subtype = 'superset'
@params_as_kwargs @params_as_kwargs
@not_broken_hgweb @not_broken_hgweb
def track_discovery_superset(self, *args, **kwargs): def track_discovery_superset(self, *args, **kwargs):
...@@ -389,9 +404,9 @@ ...@@ -389,9 +404,9 @@
@params_as_kwargs @params_as_kwargs
@not_broken_hgweb @not_broken_hgweb
def track_discovery_superset(self, *args, **kwargs): def track_discovery_superset(self, *args, **kwargs):
"""Local repository is a superset of remote.""" return self._track_discovery(self, *args, **kwargs)
return self.perfext('perfdiscovery', self.clone_path) track_discovery_superset.benchmark_name = 'basic_commands.DiscoveryTimeSuite.track_discovery_superset'
class UnbundleTimeSuite(BaseExchangeTimeSuite): class UnbundleTimeSuite(BaseExchangeTimeSuite):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment