|
| 1 | +# Mermaid flowchart generation from Galaxy workflows. |
| 2 | +# workflow_to_mermaid returns a single string; the _lines variants split on "\n" |
| 3 | +# so per-line assertions can use list-mode helpers ($length, value_any_contains). |
| 4 | + |
| 5 | +test_simple_graph_header: |
| 6 | + fixture: synthetic-graph-simple.gxwf.yml |
| 7 | + operation: workflow_to_mermaid_lines |
| 8 | + assertions: |
| 9 | + - path: [0] |
| 10 | + value: "graph LR" |
| 11 | + |
| 12 | +test_simple_graph_data_input_shape: |
| 13 | + fixture: synthetic-graph-simple.gxwf.yml |
| 14 | + operation: workflow_to_mermaid_lines |
| 15 | + assertions: |
| 16 | + - path: [] |
| 17 | + value_any_contains: 'input_0>"the_input<br/><i>data</i>"]' |
| 18 | + |
| 19 | +test_simple_graph_tool_step_shape: |
| 20 | + fixture: synthetic-graph-simple.gxwf.yml |
| 21 | + operation: workflow_to_mermaid_lines |
| 22 | + assertions: |
| 23 | + - path: [] |
| 24 | + value_any_contains: 'step_0["cat"]' |
| 25 | + |
| 26 | +test_simple_graph_edge: |
| 27 | + fixture: synthetic-graph-simple.gxwf.yml |
| 28 | + operation: workflow_to_mermaid_lines |
| 29 | + assertions: |
| 30 | + - path: [] |
| 31 | + value_any_contains: "input_0 --> step_0" |
| 32 | + |
| 33 | +test_simple_graph_exact: |
| 34 | + fixture: synthetic-graph-simple.gxwf.yml |
| 35 | + operation: workflow_to_mermaid |
| 36 | + assertions: |
| 37 | + - path: [] |
| 38 | + value: |- |
| 39 | + graph LR |
| 40 | + input_0>"the_input<br/><i>data</i>"] |
| 41 | + step_0["cat"] |
| 42 | + input_0 --> step_0 |
| 43 | +
|
| 44 | +test_multi_data_inputs_distinct_ids: |
| 45 | + fixture: synthetic-multi-data-input.gxwf.yml |
| 46 | + operation: workflow_to_mermaid_lines |
| 47 | + assertions: |
| 48 | + - path: [] |
| 49 | + value_any_contains: 'input_0>"optional<br/><i>data</i>"]' |
| 50 | + - path: [] |
| 51 | + value_any_contains: 'input_1>"required<br/><i>data</i>"]' |
| 52 | + - path: [] |
| 53 | + value_any_contains: "input_1 --> step_0" |
| 54 | + - path: [] |
| 55 | + value_any_contains: "input_0 --> step_0" |
| 56 | + |
| 57 | +test_int_input_renders: |
| 58 | + fixture: synthetic-int-input.gxwf.yml |
| 59 | + operation: workflow_to_mermaid_lines |
| 60 | + assertions: |
| 61 | + - path: [] |
| 62 | + value_any_contains: '"num_lines<br/><i>int</i>"' |
| 63 | + - path: [] |
| 64 | + value_any_contains: '"input_d<br/><i>data</i>"' |
| 65 | + |
| 66 | +test_subworkflow_step_uses_double_bracket_shape: |
| 67 | + fixture: synthetic-graph-with-subworkflow.gxwf.yml |
| 68 | + operation: workflow_to_mermaid_lines |
| 69 | + assertions: |
| 70 | + - path: [] |
| 71 | + value_any_contains: 'step_1[["nested_workflow"]]' |
| 72 | + - path: [] |
| 73 | + value_any_contains: 'step_0["first_cat"]' |
| 74 | + - path: [] |
| 75 | + value_any_contains: "step_0 --> step_1" |
| 76 | + |
| 77 | +test_frame_comments_ignored_by_default: |
| 78 | + fixture: synthetic-comments-dict.gxwf.yml |
| 79 | + operation: workflow_to_mermaid |
| 80 | + assertions: |
| 81 | + - path: [] |
| 82 | + value_contains: 'step_0["cat"]' |
| 83 | + |
| 84 | +test_frame_comments_not_emitted_without_flag: |
| 85 | + fixture: synthetic-comments-dict.gxwf.yml |
| 86 | + operation: workflow_to_mermaid |
| 87 | + assertions: |
| 88 | + - path: [] |
| 89 | + # Use [\s\S] instead of (?s) + . so both Python re and JS RegExp accept it. |
| 90 | + value_matches: '^(?![\s\S]*subgraph)' |
| 91 | + |
| 92 | +test_frame_comments_rendered_as_subgraph: |
| 93 | + fixture: synthetic-comments-dict.gxwf.yml |
| 94 | + operation: workflow_to_mermaid_with_comments_lines |
| 95 | + assertions: |
| 96 | + - path: [] |
| 97 | + value_any_contains: 'subgraph sub_0 ["Preprocessing"]' |
| 98 | + - path: [] |
| 99 | + value_any_contains: 'step_0["cat"]' |
| 100 | + - path: [] |
| 101 | + value_any_contains: "end" |
| 102 | + - path: [] |
| 103 | + value_any_contains: "input_0 --> step_0" |
| 104 | + |
| 105 | +test_basic_workflow_single_edge: |
| 106 | + fixture: synthetic-basic.gxwf.yml |
| 107 | + operation: workflow_to_mermaid_lines |
| 108 | + assertions: |
| 109 | + - path: [0] |
| 110 | + value: "graph LR" |
| 111 | + - path: [] |
| 112 | + value_any_contains: 'input_0>"the_input<br/><i>data</i>"]' |
| 113 | + - path: [] |
| 114 | + value_any_contains: 'step_0["cat"]' |
| 115 | + - path: [] |
| 116 | + value_any_contains: "input_0 --> step_0" |
| 117 | + |
| 118 | +test_real_sars_cov2_shape: |
| 119 | + fixture: real-sars-cov2-variant-calling.ga |
| 120 | + operation: workflow_to_mermaid_lines |
| 121 | + assertions: |
| 122 | + - path: [0] |
| 123 | + value: "graph LR" |
| 124 | + - path: [] |
| 125 | + value_any_contains: 'input_0>"Accessions file<br/><i>data</i>"]' |
| 126 | + - path: [] |
| 127 | + value_any_contains: 'step_8["SnpSift summary table"]' |
| 128 | + - path: [] |
| 129 | + value_any_contains: "input_0 --> step_0" |
| 130 | + - path: [] |
| 131 | + value_any_contains: "step_6 --> step_8" |
0 commit comments