test: add nested-data & filename-normalization stress guards to CI#104
Merged
Conversation
Port the standalone stress-tests/ harnesses into the automated Jest suite so regressions in already-fixed behavior are caught by plain `npm test` (and CI). The tests import from source (the CI test job runs no build) and add no library or CLI behavior. - metadata: nested-generation coherence over a comprehensive fixture, and the Psych-DS filename-normalization helper invariants. - cli: processDirectory end-to-end (compliant main CSV, data/raw/ preservation, variableMeasured <-> CSV-column cross-check, best-effort Psych-DS validation), and refusal to write a non-compliant filename non-interactively. Shared fixture lives at dev/stress/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 19b31e0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The F1a/F1b/F2 findings this fixture documented as "current behavior" were fixed in #102 (now on main). Update the assertions to verify the corrected behavior: - F1a: a numeric value in a trial_type-less row is counted in min/max (rt max = 9999) - F1b: a column only in a trial_type-less row is typed string with levels, not "unknown" - F2: a boolean column absorbs string "true"/"false" with no levels Also tighten the coherence check so any boolean-with-levels is now flagged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jodeleeuw
added a commit
that referenced
this pull request
Jun 18, 2026
) * test: add nested-data & filename-normalization stress guards to CI Port the standalone stress-tests/ harnesses into the automated Jest suite so regressions in already-fixed behavior are caught by plain `npm test` (and CI). The tests import from source (the CI test job runs no build) and add no library or CLI behavior. - metadata: nested-generation coherence over a comprehensive fixture, and the Psych-DS filename-normalization helper invariants. - cli: processDirectory end-to-end (compliant main CSV, data/raw/ preservation, variableMeasured <-> CSV-column cross-check, best-effort Psych-DS validation), and refusal to write a non-compliant filename non-interactively. Shared fixture lives at dev/stress/. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * test: add CSV-ingestion, scale, and cross-file-collision stress guards Stacked on the nested-data/filename stress suites (PR #104). Three more Jest suites, all test-only (no library/CLI behavior change): - metadata csv-input.stress: type re-inference from CSV string cells (numeric coercion, Infinity/NaN rejection, mixed-column downgrade, RFC-4180 quoting, unicode, empty/literal-null, 50-char level cap, JSON-in-cell extraction) + CSV/JSON parity. - metadata scale.stress: 5,000-row exact extremes, dedup, high-cardinality levels, boolean handling, throughput ceiling. - cli array-collision.stress: two same-stem files in different subdirs sharing a nested array column; asserts main CSV, sidecar, and raw originals each disambiguate without overwrite, staying Psych-DS valid. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: Josh de Leeuw <josh.deleeuw@gmail.com>
jodeleeuw
added a commit
that referenced
this pull request
Jun 18, 2026
…ayer overlap - Rename dataProcessingStress.test.ts -> dataProcessing.stress.test.ts to match the repo's *.stress.test.ts convention (#104/#106). - Add a header note explaining the intentional overlap with packages/metadata's stress suites: these guard generate() through the frontend bundle's own resolution path, plus frontend-only coverage (multi-file CSV+JSON accumulation, validator partitioning). No changeset: the frontend package is private and unversioned, so changesets ignores it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
We had standalone stress harnesses (
stress-tests/run-nested.mjs,run-rename.mjs) that caught real issues in nested-data generation and Psych-DS filename normalization, but they only ran manually. If a later change broke something we already fixed, nothing would tell us. This wires them into the automated suite sonpm test(and CI) guard that behavior.What
Four Jest suites, ported from the harnesses so they run under plain
npm testwith no build step (they import fromsrc, matching the existing tests; the CItestjob does not build):@jspsych/metadatanested-generation.stress.test.ts—generate()over a fixture exercising every nested-data shape (deep objects, arrays of objects/arrays, mixed-type columns, atrial_type-less row, unicode, empties); asserts each variable's stored type/levels/range stays coherent. Documented findings F1a/F1b/F2 are pinned as current behavior so the suite stays green and a new deviation is caught.rename-normalization.stress.test.ts— battery fortoPsychDSValue/isValidPsychDSDataFilename/deriveArrayFilename/disambiguateArrayFilename, including the invariant that every derived+disambiguated name is Psych-DS-compliant.@jspsych/metadata-clinested-cli.stress.test.ts—processDirectoryend-to-end: compliant main CSV from the source name, original JSON preserved underdata/raw/, two-wayvariableMeasured↔ CSV-column cross-check, and a best-effort Psych-DS validation pass (asserts 0 errors when the validator can reach the network, skipped offline — the structural checks are the source of truth).rename-reject.stress.test.ts— the non-interactive path refuses a non-compliant filename (writes nothing, reports the failure) rather than inventing a keyword.Shared fixture:
dev/stress/nested-all-cases/subject-nested.json.Notes
interactive-rename.e2e.test.tsfails to load locally becausenode-ptyisn't installed; it installs in CI vianpm ci.🤖 Generated with Claude Code