Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Poulpe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
octobus
Poulpe
Commits
0a0aa685
Commit
0a0aa685
authored
6 years ago
by
Pierre-Yves David
Browse files
Options
Downloads
Patches
Plain Diff
variants: get strip variants from config instead of hard coding them
Now that we have yaml, the sky is the limit.
parent
abada82f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
benchmarks/basic_commands.py
+9
-9
9 additions, 9 deletions
benchmarks/basic_commands.py
benchmarks/utils.py
+3
-4
3 additions, 4 deletions
benchmarks/utils.py
with
12 additions
and
13 deletions
benchmarks/basic_commands.py
+
9
−
9
View file @
0a0aa685
...
...
@@ -20,7 +20,8 @@
BaseTestSuite
,
params_as_kwargs
,
median
,
REPOS_DIR
REPOS_DIR
,
STRIP_VARIANTS
,
)
if
sys
.
version_info
[
0
]
==
2
:
...
...
@@ -28,14 +29,13 @@
else
:
import
queue
# TODO: don't hardcode
STRIP_REVSETS
=
{
'
same
'
:
"
tip
"
,
'
last-ten
'
:
"
last(all(), 10)
"
,
'
last-hundred
'
:
"
last(all(), 100)
"
,
'
last-thousand
'
:
"
last(all(), 1000)
"
,
}
STRIP_REVSETS
=
{}
for
key
,
value
in
STRIP_VARIANTS
.
items
():
if
value
is
None
:
# not sure why tip is the expected value here
STRIP_REVSETS
[
key
]
=
'
tip
'
else
:
STRIP_REVSETS
[
key
]
=
value
[
'
remove
'
]
def
get_strip_variants
():
return
[
"
same
"
,
"
last-ten
"
,
"
last-hundred
"
,
"
last-thousand
"
]
...
...
This diff is collapsed.
Click to expand it.
benchmarks/utils.py
+
3
−
4
View file @
0a0aa685
...
...
@@ -10,6 +10,7 @@
import
subprocess
import
sys
import
timeit
import
yaml
from
functools
import
wraps
REPO_SUFFIX
=
'
.benchrepo
'
...
...
@@ -20,10 +21,8 @@
REPOS_DATA
=
sorted
(
d
for
d
in
os
.
listdir
(
REPOS_DIR
)
if
d
.
endswith
(
REPO_SUFFIX
))
REPOS
=
[
r
[:
-
len
(
REPO_SUFFIX
)]
for
r
in
REPOS_DATA
]
# TODO fix
# with open(STRIP_VARIANTS_PATH) as f:
# STRIP_VARIANTS = yaml.load(f.read())["partial-sets"]
with
open
(
STRIP_VARIANTS_PATH
)
as
f
:
STRIP_VARIANTS
=
yaml
.
load
(
f
.
read
())[
"
partial-sets
"
]
class
SkipResult
(
Exception
):
pass
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment