Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Task autotest
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jiří Kalvoda
Task autotest
Commits
df421799
Commit
df421799
authored
1 year ago
by
Daniel Skýpala
Browse files
Options
Downloads
Patches
Plain Diff
Refresh: Split refresh and test_random
parent
84e533a6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
task_autotest/refresh.py
+21
-7
21 additions, 7 deletions
task_autotest/refresh.py
with
21 additions
and
7 deletions
task_autotest/refresh.py
+
21
−
7
View file @
df421799
from
copy
import
deepcopy
from
git
import
Repo
import
json
from
random
import
shuffle
import
os
...
...
@@ -7,17 +8,30 @@ import task_autotest.config as config
from
task_autotest.util
import
path_to_str
from
task_autotest.test
import
test_task_commit
def
refresh
()
->
None
:
repo
=
Repo
(
config
.
REPO_DIR
)
repo
.
remotes
.
origin
.
pull
()
tasks
=
deepcopy
(
config
.
TASKS
)
shuffle
(
tasks
)
def
refresh
()
->
dict
[
str
,
str
]:
repo
.
remotes
.
origin
.
pull
(
)
for
branch
,
task
in
tasks
:
task_commits
=
{}
for
branch
,
task
in
config
.
TASKS
:
repo
.
git
.
checkout
(
branch
)
commit_hash
=
repo
.
head
.
commit
.
hexsha
task_commits
[
task
]
=
repo
.
head
.
commit
.
hexsha
return
task_commits
def
test_random
(
task_commits
:
dict
[
str
,
str
]):
task_commits
=
list
(
task_commits
.
items
())
shuffle
(
task_commits
)
for
task
,
commit_hash
in
task_commits
:
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
config
.
DATA_DIR
,
path_to_str
(
task
),
commit_hash
)):
return
test_task_commit
(
task
,
commit_hash
)
return
None
def
run
():
with
open
(
os
.
path
.
join
(
DATA_DIR
,
"
task_commits
"
))
as
f
:
json
.
dump
(
f
,
task_commits
:
=
refresh
())
test_random
(
task_commits
)
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