Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package Registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
50916857
Commit
50916857
authored
8 months ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
mkexp: add list of removed jobs to template namespace
parent
c604d6df
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES.rst
+1
-0
1 addition, 0 deletions
CHANGES.rst
mkexp
+1
-0
1 addition, 0 deletions
mkexp
test.py
+32
-0
32 additions, 0 deletions
test.py
with
34 additions
and
0 deletions
CHANGES.rst
+
1
−
0
View file @
50916857
...
...
@@ -18,6 +18,7 @@ Config
------
* Add option to allow scripts to be non-executable
* Add list of removed jobs to template namespace
Tools
-----
...
...
This diff is collapsed.
Click to expand it.
mkexp
+
1
−
0
View file @
50916857
...
...
@@ -572,6 +572,7 @@ for subjob, subconfig in jobs_config.items():
var_format
=
job_config
[
'
JOB
'
].
get
(
'
.var_format
'
,
'
${%s}
'
)
var_list
=
set
()
job_config
[
'
jobs
'
]
=
{}
job_config
[
'
jobs
'
][
'
.remove
'
]
=
(
remove_list
[
1
:]
if
remove_list
else
[])
job_config
[
'
jobs
'
].
merge
(
expconfig
.
odict
(
jobs_config
))
expconfig
.
merge_comments
(
job_config
[
'
jobs
'
],
jobs_config
)
job_config
.
walk
(
format_vars
,
log
=
var_list
,
fmt
=
var_format
)
...
...
This diff is collapsed.
Click to expand it.
test.py
+
32
−
0
View file @
50916857
...
...
@@ -1723,6 +1723,38 @@ class JobSiblingsTestCase(MkexpSimpleTestCase):
result
=
align
(
result
)
self
.
assertMultiLineEqual
(
expected
,
result
)
class
DisabledJobsTestCase
(
MkexpSimpleTestCase
):
def
test_removed_job_in_template
(
self
):
writeconfig
(
self
.
exp_id
,
u
"""
[jobs]
.remove = job1
[[job1]]
[[job2]]
"""
)
writetemplate
(
self
.
exp_id
,
'
job2
'
,
u
"""
#% for job in jobs.sections:
%{job}
#% endfor
---
#% for job in jobs.sections:
#% if job is not in jobs[
'
.remove
'
]:
%{job}
#% endif
#% endfor
"""
)
expected
=
align
(
u
"""
job1
job2
---
job2
"""
)
ignore
=
output
(
script
(
"
mkexp
"
+
self
.
exp_id
+
"
.config
"
))
result
=
readfile
(
join
(
"
test
"
,
"
experiments
"
,
self
.
exp_id
,
self
.
exp_id
+
"
.job2
"
))
result
=
align
(
result
)
self
.
assertMultiLineEqual
(
expected
,
result
)
class
NativeVariableTestCase
(
MkexpSimpleTestCase
):
def
test_var_statement
(
self
):
...
...
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