Skip to content

Commit

Permalink
Merge pull request #108 from inab/full_circle
Browse files Browse the repository at this point in the history
Full circle 1.0.0b0
  • Loading branch information
jmfernandez authored Aug 7, 2024
2 parents 025154e + 30ce71f commit 2ba62a6
Show file tree
Hide file tree
Showing 27 changed files with 1,237 additions and 427 deletions.
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/inab/WfExS-backend"
type: software
title: "WfExS-backend"
version: 1.0.0a2
date-released: "2024-07-28"
version: 1.0.0b0
date-released: "2024-08-07"
1 change: 1 addition & 0 deletions mypy-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ types-mypy-extensions
types-openpyxl
types-paramiko
types-pluggy
types-psutil
types-pyxdg
types-PyYAML
types-requests
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,5 @@ aiohttp
pyld
rdflib >= 7.0.0 ; python_version >= '3.8'
rdflib < 7.0.0 ; python_version < '3.8'
psutil
RWFileLock >= 0.2.2
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
workflow_id: github:inab/hello-workflows/b0afc5871c6fdbd66576fcc5a3813ea49aca5104/cwl/hello-workflow.cwl
workflow_config:
secure: false
containerType: docker
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
Expand Down
14 changes: 14 additions & 0 deletions tests/core/data/test-hello-cwl-singularity.wfex.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
workflow_id: github:inab/hello-workflows/b0afc5871c6fdbd66576fcc5a3813ea49aca5104/cwl/hello-workflow.cwl
workflow_config:
secure: false
containerType: singularity
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
c-l-a-s-s: File
url: github:inab/hello-workflows/b0afc5871c6fdbd66576fcc5a3813ea49aca5104/cwl/hello.yml
environment:
SECRET_VARIABLE: "The secret content"
outputs:
hello_output:
c-l-a-s-s: File
20 changes: 20 additions & 0 deletions tests/core/data/test-hello-nxf-docker.wfex.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
workflow_id: github:inab/hello-workflows/26b45a412bb91e05c230a39fd268e65386c59d48/nextflow
workflow_config:
secure: false
containerType: docker
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
c-l-a-s-s: File
url: github:inab/hello-workflows/840236984ef4ea967b62b8a2dac1da22f7766b29/nextflow/singularity-params.config
output_dir:
c-l-a-s-s: Directory
# This hint tells that this parameter is the output directory
autoFill: true
autoPrefix: true
environment:
SECRET_VARIABLE: "The secret content"
outputs:
hello_output:
c-l-a-s-s: File
glob: "output_dir/*"
20 changes: 20 additions & 0 deletions tests/core/data/test-hello-nxf-singularity.wfex.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
workflow_id: github:inab/hello-workflows/26b45a412bb91e05c230a39fd268e65386c59d48/nextflow
workflow_config:
secure: false
containerType: singularity
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
c-l-a-s-s: File
url: github:inab/hello-workflows/840236984ef4ea967b62b8a2dac1da22f7766b29/nextflow/singularity-params.config
output_dir:
c-l-a-s-s: Directory
# This hint tells that this parameter is the output directory
autoFill: true
autoPrefix: true
environment:
SECRET_VARIABLE: "The secret content"
outputs:
hello_output:
c-l-a-s-s: File
glob: "output_dir/*"
20 changes: 20 additions & 0 deletions tests/core/data/test-hello-nxf-too-long-docker-fails.wfex.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
workflow_id: github:inab/hello-workflows/26b45a412bb91e05c230a39fd268e65386c59d48/nextflow-too-long
workflow_config:
secure: false
containerType: docker
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
c-l-a-s-s: File
url: github:inab/hello-workflows/840236984ef4ea967b62b8a2dac1da22f7766b29/nextflow/singularity-params.config
output_dir:
c-l-a-s-s: Directory
# This hint tells that this parameter is the output directory
autoFill: true
autoPrefix: true
environment:
SECRET_VARIABLE: "The secret content"
outputs:
hello_output:
c-l-a-s-s: File
glob: "output_dir/*"
22 changes: 22 additions & 0 deletions tests/core/data/test-hello-nxf-too-long-docker-fixed.wfex.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
workflow_id: github:inab/hello-workflows/26b45a412bb91e05c230a39fd268e65386c59d48/nextflow-too-long
workflow_config:
secure: false
containerType: docker
nextflow:
maxTaskDuration: "1m"
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
c-l-a-s-s: File
url: github:inab/hello-workflows/840236984ef4ea967b62b8a2dac1da22f7766b29/nextflow/singularity-params.config
output_dir:
c-l-a-s-s: Directory
# This hint tells that this parameter is the output directory
autoFill: true
autoPrefix: true
environment:
SECRET_VARIABLE: "The secret content"
outputs:
hello_output:
c-l-a-s-s: File
glob: "output_dir/*"
15 changes: 15 additions & 0 deletions tests/core/data/test-sleephello-cwl-singularity.wfex.stage
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
workflow_id: github:inab/hello-workflows/af6f6c3946072994761bd435e9f36b46b9a9f2e9/cwl/sleephello-workflow.cwl
workflow_config:
secure: false
containerType: singularity
# All the inputs must be URLs or CURIEs from identifiers.org
params:
an_input:
c-l-a-s-s: File
url: github:inab/hello-workflows/af6f6c3946072994761bd435e9f36b46b9a9f2e9/cwl/sleephello.yml
sleep_time: 10
environment:
SECRET_VARIABLE: "The secret content"
outputs:
sleephello_output:
c-l-a-s-s: File
40 changes: 36 additions & 4 deletions tests/core/test_wfexsbackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,27 @@
if TYPE_CHECKING:
from typing import (
Optional,
Sequence,
Tuple,
Type,
Union,
)
from wfexs_backend.wfexs_backend import (
WfExSConfigBlock,
)

import yaml

# We have preference for the C based loader and dumper, but the code
# should fallback to default implementations when C ones are not present
YAMLLoader: "Type[Union[yaml.Loader, yaml.CLoader]]"
YAMLDumper: "Type[Union[yaml.Dumper, yaml.CDumper]]"
try:
from yaml import CLoader as YAMLLoader, CDumper as YAMLDumper
except ImportError:
from yaml import Loader as YAMLLoader, Dumper as YAMLDumper


from wfexs_backend.wfexs_backend import WfExSBackend
from wfexs_backend.workflow import WF

Expand All @@ -57,6 +72,11 @@ def test_wfexsbackend_bootstrap(
config_directory=tmppath,
key_prefix="crypt4gh",
)

local_path = tmppath / "test-local_config.yaml"
with local_path.open(mode="w", encoding="utf-8") as cf:
yaml.dump(test_local_config, cf, Dumper=YAMLDumper)

assert bootstrap_ok
assert config_directory.is_dir()
assert (tmppath / "WORKDIRS").is_dir()
Expand Down Expand Up @@ -105,18 +125,30 @@ def test_wfexsbackend_list_workflow_engines(tmppath: "pathlib.Path") -> "None":


WORKFLOW_TESTBED = pytest.mark.parametrize(
["stage_file", "context_file"],
["stage_file", "context_file", "should_fail"],
[
("test-hello-cwl.wfex.stage", None),
("test-hello-cwl-secure.wfex.stage", None),
("test-hello-cwl-singularity.wfex.stage", None, None),
("test-hello-cwl-docker.wfex.stage", None, None),
("test-hello-cwl-secure.wfex.stage", None, None),
("test-hello-nxf-docker.wfex.stage", None, None),
("test-hello-nxf-singularity.wfex.stage", None, None),
(
"test-hello-nxf-too-long-docker-fails.wfex.stage",
None,
["test_workflow_offline_exec"],
),
("test-hello-nxf-too-long-docker-fixed.wfex.stage", None, None),
],
)


@pytest.mark.filterwarnings("ignore:.*:pytest.PytestReturnNotNoneWarning")
@WORKFLOW_TESTBED
def test_wfexsbackend_stage(
tmppath: "pathlib.Path", stage_file: "str", context_file: "Optional[str]"
tmppath: "pathlib.Path",
stage_file: "str",
context_file: "Optional[str]",
should_fail: "Optional[Sequence[str]]",
) -> "WF":
wfBackend = test_wfexsbackend_init(tmppath)

Expand Down
Loading

0 comments on commit 2ba62a6

Please sign in to comment.