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

Aperta
#203 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@raleigh-g-thompson ci sta già lavorando.

Dal 1/12/2026.

  • #204 di @raleigh-g-thompson — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
70/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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".
Lingua principale
TypeScript
Stelle
14
Fork
8
Merge medio
1g 22h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cqframework/vscode-cql

Tutte le issue di cqframework/vscode-cql

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.