Move the unit-test fixture to test-workspace and add cql-test-content as a submodule

Open
#203 0 comments 0 reactions 0 assignees View on GitHub

@raleigh-g-thompson is already working on this.

Since Dec 1, 2026.

  • #204 by @raleigh-g-thompson — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
70/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
git, typescript

Research direction

Start with .vscode-test.js, .gitignore, .vscode/launch.json, .vscodeignore, and the contributor docs named in the issue. Move the listed fixture files verbatim into test-workspace/, add cql-test-content as a submodule, and update the launch and packaging references. Done means simple-project has no references, unit tests work without the submodule, and the launch opens test-content with its expected results documented.

Written by the indexing model from the issue text.

Description

code cleanup

Background

src/__test__/resources/simple-project is both the npm test workspace and the project
the "Run Extension" launch config opens. It was put together early: one real library
(SimpleMeasure), a one-line AnotherMeasure, FHIRHelpers/FHIRCommon and a few test cases.
It doesn't cover most of what the extension does now: validation, parameters, debugging,
layout deviations, formatting, compile and runtime errors.

cqframework/cql-test-content is now a
complete IG-layout CQL project made for this. It has ten libraries and 35 test cases, and
every expected result is in EXPECTED.md. This ticket splits the two roles:

  • Unit tests keep a small, stable fixture inside this repo, so npm test never needs
    the submodule.
  • Manual UAT and the "Run Extension" launch use cql-test-content as a git submodule.

Scope

1. Move the unit-test fixture (verbatim)

git mv the contents of src/__test__/resources/simple-project/ to
src/__test__/resources/test-workspace/, with no content changes:

  • input/cql/: SimpleMeasure.cql, AnotherMeasure.cql, FHIRHelpers.cql,
    FHIRCommon.cql, cql-options.json
  • input/tests/config.json
  • input/tests/Measure/SimpleMeasure/{1111,2222,3333,91ec11b5-…,shared}/
  • input/tests/Measure/AnotherMeasure/{3333,4444}/
  • input/tests/Measure/LibWithTests/1111/.gitkeep
  • .vscode/launch.json

Then update the three references:

File Change
.vscode-test.js workspaceFolder: './src/__test__/resources/test-workspace'
.gitignore src/__test__/resources/test-workspace/input/tests/results
.vscode/launch.json see step 2 ("Run Extension")

Then remove simple-project/, which is empty after the move. About 13 test files assert on
the fixture's library and case names. They reach it through the workspace folder, not by
path, so they shouldn't change.

2. Add cql-test-content as a submodule
  • git submodule add https://github.com/cqframework/cql-test-content.git test-content,
    pinned to the current main.
  • Point "Run Extension" in .vscode/launch.json at ${workspaceFolder}/test-content (the
    IG root) instead of simple-project.
  • Add test-content/ to .vscodeignore, so the VSIX doesn't include it.
  • Add a short note to the contributor docs:
    • run git submodule update --init after cloning;
    • "Run Extension" opens test-content;
    • expected results are in test-content/EXPECTED.md.

Out of scope

  • CI submodules: true: npm test doesn't use the submodule. Add it when an LS-backed test
    first needs it.
  • LS-backed smoke tests against cql-test-content: a follow-up.
  • Extension bugs cql-test-content exposed: separate tickets.
    • cql-config.schema.json lacks resultFormat, flatResultsInSubfolder and several
      parameter types.
    • The test-folder match is case-sensitive, so lowercase measure/ is flagged.
    • The validateTestCase result types don't match the LS (numbers, not strings).

Acceptance criteria

  • npm test passes locally and in CI, with no submodule checked out.
  • src/__test__/resources/simple-project/ no longer exists, and nothing references it
    (git grep simple-project is empty).
  • The files moved into test-workspace/ are byte-for-byte unchanged (git diff -M
    shows only renames).
  • "Run Extension" opens test-content/. The CQL Explorer lists the ten libraries.
    Execute CQL on CMS10FHIRSampleScreening matches its EXPECTED.md section.
  • npx @vscode/vsce ls shows no test-content/ files.
  • A fresh git clone --recurse-submodules builds and runs "Run Extension".
Dominant language
TypeScript
Stars
14
Forks
8
Avg merge
1d 22h
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cqframework/vscode-cql

All issues in cqframework/vscode-cql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.