Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
slapos
Commits
5e0cdf6f
Commit
5e0cdf6f
authored
Jul 26, 2021
by
Thomas Gambier
🚴🏼
Browse files
Options
Browse Files
Download
Plain Diff
slapos-sr-testing: Add instance parameters to filter what is tested
See merge request
nexedi/slapos!1011
parents
1a1efa41
c2856de1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
11 deletions
+30
-11
software/slapos-sr-testing/buildout.hash.cfg
software/slapos-sr-testing/buildout.hash.cfg
+1
-1
software/slapos-sr-testing/instance.cfg
software/slapos-sr-testing/instance.cfg
+29
-10
No files found.
software/slapos-sr-testing/buildout.hash.cfg
View file @
5e0cdf6f
...
@@ -15,4 +15,4 @@
...
@@ -15,4 +15,4 @@
[template]
[template]
filename = instance.cfg
filename = instance.cfg
md5sum =
5d1320a9b1d2828f2870e3096f1c2bfb
md5sum =
733643122fb75dfd7374b973a95fa2ea
software/slapos-sr-testing/instance.cfg
View file @
5e0cdf6f
...
@@ -4,7 +4,7 @@ parts +=
...
@@ -4,7 +4,7 @@ parts +=
publish
publish
[slap-configuration]
[slap-configuration]
recipe = slapos.cookbook:slapconfiguration
recipe = slapos.cookbook:slapconfiguration
.serialised
computer = ${slap-connection:computer-id}
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
url = ${slap-connection:server-url}
...
@@ -40,15 +40,34 @@ template = inline:
...
@@ -40,15 +40,34 @@ template = inline:
recipe = slapos.recipe.template:jinja2
recipe = slapos.recipe.template:jinja2
rendered = ${:workdir}/.nxdtest
rendered = ${:workdir}/.nxdtest
workdir = ${directory:nxdtest-working-dir}
workdir = ${directory:nxdtest-working-dir}
template = inline:
tests = {{ tests | indent(2) }}
{% for test in tests.splitlines() %}
template =
inline:{% raw %}
{%- set only_sr = slapparameter_dict.get('only-sr') %}
{%- if not isinstance(only_sr, list) %}
{%- set only_sr = [only_sr] %}
{%- endif %}
{%- set unittest_args = slapparameter_dict.get('unittest-args', ['discover', '-v']) %}
{%- if not isinstance(unittest_args, list) %}
{%- set unittest_args = [unittest_args] %}
{%- endif %}
command = {{ repr([interpreter, '-m', 'unittest'] + unittest_args) }}
{%- for test in tests.splitlines() %}
{%- set name, folder = test.split() %}
{%- if not only_sr or name in only_sr %}
TestCase(
TestCase(
{{ repr(test.split()[0]
) }},
{{ repr(name
) }},
[ {{ repr(interpreter) }}, '-m', 'unittest', 'discover', '-v']
,
command
,
cwd={{ repr(test.split()[1]
) }},
cwd={{ repr(folder
) }},
summaryf=UnitTest.summary,
summaryf=UnitTest.summary,
)
)
{% endfor %}
{%- endif %}
{%- endfor %}
{%- endraw %}
context =
key slapparameter_dict slap-configuration:configuration
key tests :tests
raw interpreter {{ interpreter }}
[runTestSuite]
[runTestSuite]
env.sh = ${slapos-test-runner-nxdtest-environment.sh:rendered}
env.sh = ${slapos-test-runner-nxdtest-environment.sh:rendered}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment