Skip to content

Declarative YAML test coverage for gxformat2.cytoscape#196

Merged
jmchilton merged 1 commit intogalaxyproject:mainfrom
jmchilton:cytoscape_declarative_tests
Apr 27, 2026
Merged

Declarative YAML test coverage for gxformat2.cytoscape#196
jmchilton merged 1 commit intogalaxyproject:mainfrom
jmchilton:cytoscape_declarative_tests

Conversation

@jmchilton
Copy link
Copy Markdown
Member

Summary

  • Add gxformat2/examples/expectations/cytoscape.yml with 13 declarative cases covering cytoscape_elements output (group counts, input node shape, tool step shape, edge shape, int input step type, subworkflow classes, subworkflow edges with named output, multi-data inputs, real-workflow repo_link from tool_shed_repository, and a real-workflow node-id smoke). Consumed by the existing DeclarativeTestSuite harness so downstream ports (TypeScript galaxy-tool-util) can sync and reuse them.
  • Register cytoscape_elements_to_list, cytoscape_node_ids, cytoscape_edge_ids in tests/test_interop_tests.py OPERATIONS. The two _ids variants return list-of-string for value_set / value_any_contains assertions; _to_list returns the canonical flat list-of-dicts.
  • Fixtures reuse existing synthetic-* / real-* files — no new workflow fixtures.
  • Thin tests/test_cytoscape.py retained for things that aren't a pure function of (workflow dict) → result: CLI JSON/HTML output modes, render_html, _input_type_str on a string[] input, and the Java interop generator.
  • Fix latent test pollution: test_interop_generation was leaking a tmp*.gxwf.yml / tmp*.gxwf.cytoscape.json pair into tests/examples/cytoscape/ on each run because write_cytoscape_elements_for_string named its staging file via tempfile.NamedTemporaryFile. Now takes an explicit filename arg (with_report.gxwf.yml); write_cytoscape_elements skips its self-copy when src == dst.

Mirrors #194 (mermaid) one-for-one.

Test plan

  • pytest tests/ — 642 passed, 8 skipped (no regressions; 13 new declarative cases × 2 = 28 over the previous 631 + 1 thinned-out test ≈ 642)
  • Re-run leaves tests/examples/cytoscape/ with exactly 4 deterministic files (no new tmp* accumulation)
  • TypeScript port consumes cytoscape.yml via make sync-workflow-expectations (will land alongside the TS cytoscape port, see WF_VIZ_1)

Mirrors the gxformat2.mermaid PR (galaxyproject#194). Adds
gxformat2/examples/expectations/cytoscape.yml with 13 cases covering
node/edge structure, input step types, subworkflow shape, multi-data
inputs, tool_shed_repository → repo_link, and a real-workflow smoke.
Registers cytoscape_elements_to_list / cytoscape_node_ids /
cytoscape_edge_ids in OPERATIONS so downstream ports (TypeScript
galaxy-tool-util) can sync and reuse the same cases.

Thin tests/test_cytoscape.py retained for things that aren't a pure
function of (workflow dict) -> result: CLI JSON/HTML output modes,
render_html, _input_type_str on a string-list input, and the Java
interop generator.

Fix tests/test_cytoscape.py::test_interop_generation leaking a
tmp*.gxwf.* pair into tests/examples/cytoscape/ on every run —
write_cytoscape_elements_for_string now takes an explicit filename and
write_cytoscape_elements skips a self-copy when src == dst.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 41.03%. Comparing base (06e8536) to head (b1839f7).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #196   +/-   ##
=======================================
  Coverage   41.03%   41.03%           
=======================================
  Files          51       51           
  Lines        1974     1974           
  Branches      441      441           
=======================================
  Hits          810      810           
  Misses       1047     1047           
  Partials      117      117           
Flag Coverage Δ
unittests 41.03% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jmchilton jmchilton merged commit 0759a16 into galaxyproject:main Apr 27, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant