diff --git a/benten/cwl/typeinference.py b/benten/cwl/typeinference.py index 3e3d442..c4102e9 100644 --- a/benten/cwl/typeinference.py +++ b/benten/cwl/typeinference.py @@ -7,9 +7,6 @@ from .anytype import CWLAnyType from .namespacedtype import CWLNameSpacedType -import logging -logger = logging.getLogger(__name__) - def infer_type(node, allowed_types, key: str = None, map_sp: MapSubjectPredicate = None) -> CWLBaseType: diff --git a/tests/cwl/misc/remote-steps.cwl b/tests/cwl/misc/remote-steps.cwl deleted file mode 100644 index f23a7cf..0000000 --- a/tests/cwl/misc/remote-steps.cwl +++ /dev/null @@ -1,112 +0,0 @@ -cwlVersion: v1.0 - -class: Workflow -label: WIP-DAPHNI DNA Pre-Processing - -requirements: - InlineJavascriptRequirement: {} - MultipleInputFeatureRequirement: {} - StepInputExpressionRequirement: {} - -inputs: - ForwardReads: File - ReverseReads: File - BWA-Index: File - MaxThreads: int - SampleID: string #normal or tumor - KnownSiteVCF: File - -steps: - Alignment: - run: https://gitlab.com/iidsgt/biocwl/raw/master/Tools/BWA/BWA-Mem.cwl - in: - InputFile: [ForwardReads, ReverseReads] - Index: BWA-Index - isMarkShortSplit: - default: true - RgLine: - valueFrom: $("@RG\\tID:" + inputs.SampleID + "\\tSM:sample\\tLB:sample\\tPL:ILLUMINA\\tPU:0") - VerboseLevel: - default: 1 - Threads: MaxThreads - - out: [reads_stdout] - - ConvertSamToBam: - run: https://gitlab.com/iidsgt/biocwl/raw/master/Tools/Samtools-View.cwl - in: - InputFile: Alignment/reads_stdout - Format: - valueFrom: | - ${ return {"BAM": true}} - Threads: MaxThreads - - out: [alignment] - - FixMateInformation: - run: https://gitlab.com/iidsgt/biocwl/raw/master/Tools/GATK-FixMateInformation.cwl - in: - InputFile: ConvertSamToBam/alignment - MaxRecordsRam: - default: 2000000 - SortOrder: - default: coordinate - ValidationStringency: - default: STRICT - - out: [alignment] - - MarkDuplicates: - run: https://gitlab.com/iidsgt/biocwl/raw/master/Tools/GATK-MarkDuplicates.cwl - in: - InputFile: FixMateInformation/alignment - - out: [alignment, metrics] - - #BQSR: - # run: ../Tools/GATK-BQSRPipelineSpark.cwl - # in: - # InputFile: [MarkDuplicates/index] - # SparkMaster: - # source: MaxThreads - # valueFrom: $("local[" + self + "]") - # Reference: 2BitReference - # KnownSites: KnownSiteVCF - # isCreateBamIndex: - # default: true - # out: - # [index] - - BaseRecalibrator: - run: https://gitlab.com/iidsgt/biocwl/raw/master/Tools/GATK-BaseRecalibrator.cwl - in: - InputFile: MarkDuplicates/alignment - Reference: BWA-Index - KnownSites: KnownSiteVCF - isCreateBamIndex: - default: false - out: [table] - - ApplyBQSR: - run: https://gitlab.com/iidsgt/biocwl/raw/master/Tools/GATK-ApplyBQSR.cwl - in: - InputFile: MarkDuplicates/alignment - BaseRecalFile: BaseRecalibrator/table - isCreateBamIndex: - default: true - out: [alignment, index] - -outputs: - Final_Bam: - type: File - outputSource: ApplyBQSR/alignment - - Final_Bam_Index: - type: File - outputSource: ApplyBQSR/index - - MarkDuplicates_Metrics: - type: File - outputSource: MarkDuplicates/metrics - - diff --git a/tests/cwl/misc/wf-remote-steps.cwl b/tests/cwl/misc/wf-remote-steps.cwl new file mode 100644 index 0000000..95b87f7 --- /dev/null +++ b/tests/cwl/misc/wf-remote-steps.cwl @@ -0,0 +1,29 @@ +# This test is somewhat brittle because it assumes the +# existence of this repository on github. If github +# disappears, or this repository is no longer hosted there +# the CWL for this test will have to be updated. + +cwlVersion: v1.0 +class: Workflow + +inputs: + in1: string + +steps: + step1: + run: https://raw.githubusercontent.com/rabix/benten/4223a4/tests/cwl/misc/clt1.cwl + in: + in1: in1 + out: [out1] + + step2: + run: https://raw.githubusercontent.com/rabix/benten/5223a4/tests/cwl/misc/clt1.cwl + in: + in1: in1 + out: [out1] + + +outputs: + out1: + type: string + outputSource: [step1/out1, step2/out1] diff --git a/tests/test_code_intelligence.py b/tests/test_code_intelligence.py index 29e1c09..bc54ba9 100644 --- a/tests/test_code_intelligence.py +++ b/tests/test_code_intelligence.py @@ -97,3 +97,20 @@ def test_port_completer(): cmpl = doc.completion(Position(24, 9)) # Is a list assert "in1" in [c.label for c in cmpl] + + +# This test is somewhat brittle because it assumes the +# existence of this repository on github. If github +# disappears, or this repository is no longer hosted there +# the CWL for this test will have to be updated. +def test_remote_files(): + this_path = current_path / "cwl" / "misc" / "wf-remote-steps.cwl" + doc = load(doc_path=this_path, type_dicts=type_dicts) + + # Refers to an earlier commit + hov = doc.hover(Position(13, 32)) + assert "class:" in hov.contents.value + + # Non existent commit + hov = doc.hover(Position(19, 32)) + assert hov.contents.value == "```\n\n```"