Skip to content

Comments

refactor: standardize integration tests with run-snapshot-test helper#35

Merged
maxim-uvarov merged 13 commits intomainfrom
refactor/integration-test-variants
Dec 31, 2025
Merged

refactor: standardize integration tests with run-snapshot-test helper#35
maxim-uvarov merged 13 commits intomainfrom
refactor/integration-test-variants

Conversation

@maxim-uvarov
Copy link
Member

@maxim-uvarov maxim-uvarov commented Dec 31, 2025

Summary

  • Extract run-snapshot-test helper for consistent snapshot-based integration testing
  • All 5 integration tests now use the shared helper with self-documenting output files
  • Add coverage integration test to track untested public API commands
  • Fix typo in filename: keep_bulitinskeep_builtins

Cross-platform fixes

  • Fix keyword detection: Exclude def and export def from callees (they have shape_internalcall in AST but are keywords, not command calls)
  • Fix ordering: Sort paths in dependencies command for consistent output across platforms (glob returns different order on Linux vs Windows vs macOS)
  • Fix Windows paths: Use path join for glob patterns in coverage test instead of Unix-style hardcoded paths

Test plan

  • nu toolkit.nu test passes (44 unit + 5 integration tests)
  • Output files include command headers showing how they were generated
  • CI passes on both Ubuntu and Windows

🤖 Generated with Claude Code

claude and others added 12 commits December 30, 2025 21:53
Uses dotnu's own filter-commands-with-no-tests to track which
public API commands lack test coverage. Outputs a snapshot that
will show changes in git diff when coverage changes.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidates the self-documenting snapshot pattern (command source
as header comment + output) into a reusable helper. Reduces
duplication in dependency tests from 40 lines to 10.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Replace hardcoded forward-slash paths with path join for
cross-platform support.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Eliminates duplicate mkdir/rm/save boilerplate. Coverage snapshot
now includes the generating code as header comments.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Explains the git-as-assertion pattern and self-documenting snapshots
for future maintainers.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Convert test-embeds-remove and test-embeds-update to use the shared helper
- Output files now include self-documenting command headers
- Fix typo in filename: keep_bulitins -> keep_builtins

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Keywords like `def` and `export def` have shape `shape_internalcall` in
the AST, causing them to incorrectly appear as callees when using
--keep-builtins. Now keywords are always filtered out regardless of the
--keep-builtins flag.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Glob returns files in different order on different platforms (Linux vs
Windows vs macOS). Adding explicit sort ensures consistent output order
for dependencies command across all platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Unix-style paths like "tests/test_commands.nu" may not work correctly
on Windows. Using path join ensures glob patterns work across all
platforms.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@maxim-uvarov maxim-uvarov force-pushed the refactor/integration-test-variants branch from 6d06713 to afd119e Compare December 31, 2025 01:45
@maxim-uvarov maxim-uvarov merged commit ad64194 into main Dec 31, 2025
2 checks passed
@maxim-uvarov maxim-uvarov deleted the refactor/integration-test-variants branch December 31, 2025 02:02
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.

2 participants