Skip to content

Keep Stata's system globals out of property tests that expect an undefined global - #399

Merged
jbearak merged 2 commits into
mainfrom
test/exclude-system-globals
Nov 6, 2026
Merged

jbearak merged 2 commits into
mainfrom
test/exclude-system-globals

Conversation

@jbearak

@jbearak jbearak commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

CI failed on #397 in a property test that has nothing to do with it. The test generates random global names and expects each to draw UNDEFINED_MACRO. It generated S_OS. Stata always defines S_OS, and the analyzer correctly stays quiet about it (STATA_SYSTEM_GLOBALS), so the property failed. Counterexample: ["S_OS","AAA","_AA"] gives only $AAA is not defined and $_AA is not defined.

Five property files could hit this. In each, only global inputs exclude the 15 system globals:

  • tests that only use globals use a filtered generator;
  • tests that pick local or global per run skip only global runs with a system name (fc.pre), so local coverage is unchanged;
  • string-literal-macro-detection now also expects a system global to draw no warning.

Proof: with every capitalized name temporarily counted as a system global, main's versions of these five files fail 12 tests. With this branch, only 3 fail, and their generators can't produce an S_ name. To find every affected test, I temporarily treated every global as a system global and checked each test that failed. Typecheck, lint, and bun test ./tests pass.

Reviewed with sol-loop: 2 rounds with gpt-6.1-sol. Sol verdict: approved

Created with Claude Opus 5.5 in T3 Code.

Summary by CodeRabbit

  • Tests
    • Updated macro diagnostic checks to account for Stata system globals, avoiding incorrect undefined-global warnings for recognized system names.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Property tests now exclude names in STATA_SYSTEM_GLOBALS from undefined-global cases. The string-literal property also expects no undefined-macro warning for a system-global name.

Changes: System-global property tests

Layer / File(s) Summary
Update generated names and diagnostic expectations
tests/property/ast-token-diagnostic-consistency.prop.test.ts, tests/property/forward-reference-detection.prop.test.ts, tests/property/genuine-undefined-macro-detection.prop.test.ts, tests/property/string-literal-macro-detection.prop.test.ts, tests/property/symbol-name-extraction.prop.test.ts
The properties filter Stata system globals from generated undefined-global cases. The string-literal property expects zero undefined-macro warnings for system-global names and one for other generated global names and local names.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Merge Risk: Minimal · up to 83857

The updated properties account for system globals. No merge-blocking issue was found.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: excluding Stata system globals from property tests that expect undefined-global warnings.
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 5 files.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: a63cdd1e-f879-4512-90c4-5e13fd3ef706
Commits

Reviewing files that changed from the base of the PR and between c115312 and 83857e7.

Files selected for processing: 5

  • tests/property/ast-token-diagnostic-consistency.prop.test.ts
  • tests/property/forward-reference-detection.prop.test.ts
  • tests/property/genuine-undefined-macro-detection.prop.test.ts
  • tests/property/string-literal-macro-detection.prop.test.ts
  • tests/property/symbol-name-extraction.prop.test.ts

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

@jbearak
jbearak merged commit 58dca01 into main Nov 6, 2026
14 checks passed
@jbearak
jbearak deleted the test/exclude-system-globals branch November 6, 2026 00:39
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