Skip to content

test(compat): compare whole files, and replay rows of text files - #167

Merged
oesteban merged 1 commit into
masterfrom
fix/compat-text-files
Dec 6, 2026
Merged

oesteban merged 1 commit into
masterfrom
fix/compat-text-files

Conversation

@oesteban

@oesteban oesteban commented Dec 5, 2026

Copy link
Copy Markdown
Member

Summary

The compatibility matrix failed on rows of text files while the clients behaved as they should. Replaying the rows of tpl-MNI152NLin2009cSym's migration (WP5's pilot) found two harness defects; its CerebA lookup table gets an n/a row, the first text file any replay has had.

 runtime/scenario.py
   op_get -> {paths, contents (first 200 bytes, for messages and missed()),
+            sha256 (of the whole file)}
 test_compat.py
   assert_found
-    contents[0] == expected.decode()         # 200 bytes against the whole file
+    sha256[0] == sha256(expected)
 datalad_archive.py
   DataladArchive(work, rows, text,
+                 files,                       # the bytes S3 serves before the table
                  bin_dir)
-    old files: made-up bytes                 # S3 serves the real bytes of text files
+    old files: files[old]; tests expect DataladArchive.contents[old]
 sample-renames.tsv
+  tpl-MNI152NLin2009cSym/..._atlas-CerebA_dseg.tsv   n/a   (a text file)

Evidence

Local runs (Python 3.13; clients 25.0.4, 25.1.2 and the branch; build-skeletons.py of templateflow/templateflow master unless noted):

master harness, new sample table:    6 failed, 10 passed, 2 xfailed  (pinned x3, released_update x2, branch_update)
this branch, sample table:           16 passed, 2 xfailed
this branch, the pilot's rows        16 passed, 2 xfailed   (master harness: 7 failed)
  (TEMPLATEFLOW_COMPAT_TEMPLATE=tpl-MNI152NLin2009cSym, build-skeletons.py of
   templateflow/templateflow#219)

On master, the failing tests found the right path, and the content's first 189 or more characters matched. In the DataLad home, client 26.0 served the removed table from S3, as it should, but the fixture expected made-up bytes.

The Compatibility workflow of this PR runs the new sample table.

Merge Danger

Door: two-way

Tests only, plus one line in CHANGES.

Blast Radius: tests

The sample table now spans two templates. The DataLad tests still use the template with the most rows (tpl-MNI152Lin), so they exercise text files only in replays of tables that have them, such as the WP5 template PRs.

Rows of text files failed the matrix while the clients behaved as they
should (found with the rows of tpl-MNI152NLin2009cSym's migration, whose
CerebA lookup table gets an n/a row):

* the scenario reported the first 200 bytes of each file, and the tests
  compared them with the whole file. It now also reports each file's
  sha256, which the tests compare;
* the DataLad Archive wrote made-up bytes for every old file of the rows,
  while S3 serves the real bytes of text files. It now holds the bytes S3
  serves before the table, and the tests expect those.

The sample table also removes the CerebA table (n/a), so that the matrix
runs a text file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codecov

codecov Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.49%. Comparing base (51e677a) to head (28beb7d).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #167   +/-   ##
=======================================
  Coverage   85.49%   85.49%           
=======================================
  Files          10       10           
  Lines         924      924           
  Branches      193      193           
=======================================
  Hits          790      790           
  Misses         70       70           
  Partials       64       64           
Flag Coverage Δ
api,datalad 44.80% <ø> (ø)
api,dls3 20.99% <ø> (ø)
api,s3 52.16% <ø> (ø)
config 83.44% <ø> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

@oesteban
oesteban marked this pull request as ready for review December 6, 2026 08:23
@oesteban
oesteban merged commit e6fc039 into master Dec 6, 2026
17 checks passed
@oesteban
oesteban deleted the fix/compat-text-files branch December 6, 2026 08:26
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-06T08:26:24.864256Z 28beb7d Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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