Skip to content

Add comprehensive regression test script (closes #83) - #86

Merged
tk3369 merged 1 commit into
masterfrom
feature/issue-83-regression-script
May 30, 2026
Merged

Add comprehensive regression test script (closes #83)#86
tk3369 merged 1 commit into
masterfrom
feature/issue-83-regression-script

Conversation

@tk3369

@tk3369 tk3369 commented May 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds test/regression.jl — a standalone script that computes SHA256 digests of all 34 SAS7BDAT test files and supports before/after comparison to catch data-reading regressions.

Usage

# Before making changes (on parent commit):
julia test/regression.jl save regression_baseline.txt

# After making changes:
julia test/regression.jl compare regression_baseline.txt

Exit code 0 = all match, 1 = differences found (CI-friendly).

How it works

  • Covers all 6 test data directories (34 files); skips zero_variables.sas7bdat and gracefully handles any file that fails to read
  • SHA256 is computed over: row/column counts, column names, and each column's raw data bytes (type-dispatched: Float64 → raw IEEE-754 bytes, strings → UTF-8 + null separators, dates/datetimes → Int64 epoch values)
  • Pkg.activate only fires when run as the entry-point script

How I tested this

Save mode — ran julia test/regression.jl save /tmp/clean_baseline.txt and confirmed all 34 files were processed and the digest file written correctly.

Compare mode (no change) — ran julia test/regression.jl compare /tmp/clean_baseline.txt immediately after; confirmed output: 34 / 34 files match. All files match. No regressions detected.

Compare mode (injected regression) — temporarily patched src/SASLib.jl to add 999.0 to the first float value of every numeric column when reading data_AHS2013/homimp.sas7bdat, then re-ran compare. Output:

33 / 34 files match

DIFFERENCES (1 files):
  DIFF  data_AHS2013/homimp.sas7bdat
        baseline: 408b3e1493f8319edc26f3720a70e3119f7733de9bdf66ed3cee8785417c4fdf
        current:  9aa5acb78c18e503d775be5b65e49d6fb6d7591adb9b871a5e38e945b7588a99

The script correctly detected the single corrupted file and reported its before/after digests.

Related

🤖 Generated with Claude Code

Adds test/regression.jl with two modes:
- save: computes SHA256 digests of all 34 test SAS files and writes them to a digest file
- compare: compares a saved baseline against fresh digests (or a second saved file) and reports DIFF/NEW/GONE per file

Typical workflow: save a baseline on the parent commit, then run compare after making changes to catch any unintended data-reading regressions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@tk3369
tk3369 merged commit a347452 into master May 30, 2026
4 of 5 checks passed
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.

Comprehensive regression test

1 participant