-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""Filter provides a list of cylc tests for each job runner. | ||
Use thus: `{{ "<job_runner>" | tests }}` | ||
""" | ||
|
||
BS_TESTS = """ | ||
tests/functional/cylc-poll/06-loadleveler.t | ||
tests/functional/cylc-poll/07-pbs.t | ||
tests/functional/cylc-poll/08-slurm.t | ||
tests/functional/cylc-poll/09-lsf.t | ||
tests/functional/directives/00-loadleveler.t | ||
tests/functional/directives/02-slurm.t | ||
tests/functional/directives/03-pbs.t | ||
tests/functional/execution-time-limit/02-slurm.t | ||
tests/functional/execution-time-limit/03-pbs.t | ||
tests/functional/job-kill/02-loadleveler.t | ||
tests/functional/job-kill/03-slurm.t | ||
tests/functional/job-kill/04-pbs.t | ||
""".strip().split('\n') | ||
|
||
|
||
def tests(group='slurm'): | ||
# Tests: | ||
# Remove / | ||
# Remove leading tests/functional | ||
# Remove trailing .t | ||
# Add the word test because cylc is not an allowed task name start | ||
sep = ', ' | ||
tests = [] | ||
for test in BS_TESTS: | ||
if group in test: | ||
tests.append(test) | ||
tests = [ | ||
f"test_{t.split('/')[2]}---{t.split('/')[3]}".replace('.t', '') | ||
for t in tests | ||
] | ||
|
||
fin = sep.join(tests) | ||
return fin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Test Cylc Job Runner Specific tests | ||
|
||
Run Cylc tests which use job runners. | ||
Options for Cylc commands | ||
* `-z groups=slurm,pbs,lsf,loadleveler`. Defaults to slurm. | ||
* `-s 'platform="spice"'`. Defaults to spice. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
|
||
import sys | ||
|
||
name = sys.argv[1] | ||
path = name[5:].split('---') | ||
path[1] += '.t' | ||
print('/'.join(path)) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
# Create the readmefile | ||
|
||
cylc config . -i '[meta]title' > README.md | ||
echo "" >> README.md | ||
cylc config . -i '[meta]description' >> README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!jinja2 | ||
{% if groups is not defined %} | ||
{% set groups=["slurm"] %} | ||
{% endif %} | ||
|
||
[meta] | ||
title = Test Cylc Job Runner Specific tests | ||
description = """ | ||
Run Cylc tests which use job runners. | ||
Options for Cylc commands | ||
* `-z groups=slurm,pbs,lsf,loadleveler`. Defaults to slurm. | ||
* `-s 'platform="spice"'`. Defaults to spice. | ||
""" | ||
created on = 2024-12-16T15 | ||
|
||
{% for group in groups %} | ||
[task parameters] | ||
{{group}}test = {{ group | tests }} | ||
[[templates]] | ||
{{group}}test = %({{group}}test)s | ||
{% endfor %} | ||
|
||
[scheduling] | ||
cycling mode = integer | ||
[[graph]] | ||
{% for group in groups %} | ||
R1 = {{ group | upper }}:succeed-all => fin | ||
{% endfor %} | ||
|
||
[runtime] | ||
{% for group in groups %} | ||
[[{{ group | upper }}]] | ||
{% endfor %} | ||
[[SLURM, PBS, LOADLEVELLER]] | ||
[[TESTS]] | ||
script = """ | ||
micromamba activate cylc.dev | ||
set -eux pipefail | ||
CYLC_PATH="${HOME}/repos/cylc-flow" | ||
TEST=${CYLC_PATH}/tests/functional/$(get-test-name ${CYLC_TASK_NAME}) | ||
echo ${TEST} | ||
${CYLC_PATH}/etc/bin/run-functional-tests -vvv -p '*' ${TEST} | ||
if [[ $(grep NOTEST ${CYLC_TASK_LOG_ROOT}.out) ]]; then | ||
echo "No test actually run" | ||
cylc message -- "No test run" | ||
exit 1 | ||
fi | ||
""" | ||
platform = {{ platform | default("spice", true) }} | ||
[[[outputs]]] | ||
no_platform = "No test run" | ||
|
||
{% for group in groups %} | ||
[[<{{group}}test>]] | ||
inherit = {{ group | upper }}, TESTS | ||
{% endfor %} | ||
|
||
[[fin]] | ||
|