CACHE_GOLDEN_PLAN

Declarative Cache Golden Tests

Goal

Add a YAML-driven test suite that exercises the full tool ID resolution + cache key + cache read pipeline against golden fixture data. The same YAML manifest and golden cache files become the cross-language contract when we build the Node proxy package for the VS Code extension.

Status

COMPLETE — Commit a05b6f8215 on wf_tool_state_applications.

What Was Built

  1. cache_golden.yaml — manifest with 4 real tools (fastqc, multiqc, trimmomatic, cat1), unparseable IDs, and version-from-separate-arg cases
  2. cache_golden/ — golden cache directory with real ToolShed API responses (not synthetic)
  3. test_tool_caching_golden.py — 11 tests across 5 classes
  4. generate_golden_cache.py — regeneration script that fetches fresh from the ToolShed API

Design Decisions

Test Coverage

ClassTestsWhat it exercises
TestToolshedTools2parse + cache_key, full cache load with rich assertions
TestStockTools2cache_key for stock tools, cache load with assertions
TestUnparseableToolIds14 tool IDs that should return None
TestVersionFromSeparateArg3parse yields None version, same key as embedded, full cache load
TestGoldenIntegrity3all JSON valid as ParsedTool, manifest↔golden consistency, index↔golden consistency

Files

test/unit/tool_util/workflow_state/
  cache_golden/                      # real ToolShed API responses
    index.json                       # CacheIndex with 4 entries
    {sha256_fastqc}.json             # devteam/fastqc 0.74+galaxy0
    {sha256_multiqc}.json            # iuc/multiqc 1.11+galaxy1
    {sha256_trimmomatic}.json        # pjbriggs/trimmomatic 0.39+galaxy2
    {sha256_cat1}.json               # stock cat1 1.0.0
  cache_golden.yaml                  # manifest driving the tests
  generate_golden_cache.py           # fetch from ToolShed API, write golden dir
  test_tool_caching_golden.py        # pytest file consuming the manifest

Resolved Questions