Skip to content

ci: add Windows testing - #97

Merged
maxim-uvarov merged 3 commits into
mainfrom
feat/win_ci
Dec 15, 2025
Merged

maxim-uvarov merged 3 commits into
mainfrom
feat/win_ci

Conversation

@maxim-uvarov

Copy link
Copy Markdown
Member

Summary

  • Add Windows CI testing using matrix strategy (ubuntu-latest + windows-latest)
  • Set fail-fast: false to run all OS tests independently
  • Add step to show git diff after integration tests for easier debugging

Test plan

  • Verify CI passes on Ubuntu
  • Verify CI passes on Windows
  • Check git diff output appears in CI logs

🤖 Generated with Claude Code

claude and others added 2 commits December 15, 2025 19:31
Added matrix strategy to run tests on both ubuntu-latest and windows-latest.
Set fail-fast to false to allow all OS tests to complete independently.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add step to display git diff of files modified during test execution. This helps diagnose test-related changes in CI output.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude

claude Bot commented Dec 15, 2025

Copy link
Copy Markdown

PR Review: CI Add Windows Testing

Summary

This PR adds Windows testing to the CI workflow using a matrix strategy, which is an excellent improvement for cross-platform compatibility. The changes are minimal and well-focused.

✅ Positive Aspects

  1. Cross-platform testing: Adding Windows testing is crucial for a Nushell tool that should work across platforms
  2. Matrix strategy: Using fail-fast: false is the right approach - it ensures both OS tests run independently, providing complete feedback
  3. Debugging aid: The git diff step is helpful for diagnosing test-related file changes in CI logs
  4. Minimal changes: The PR is focused and doesn't introduce unnecessary complexity

🔍 Code Quality

The implementation is clean and follows GitHub Actions best practices:

  • Proper use of matrix strategy
  • Correct templating syntax ${{ matrix.os }}
  • Setting fail-fast: false is appropriate for platform testing

⚠️ Potential Issues & Recommendations

1. Git diff step should not fail CI (Important)

Issue: The git diff step at line 37 will fail the entire CI run if git diff exits with non-zero status (which happens when there are differences).

Recommendation: Add continue-on-error: true or use if: always():

- name: Show diff of changed files
  if: always()
  run: git diff

Or:

- name: Show diff of changed files
  continue-on-error: true
  run: git diff

The if: always() approach is preferable since it will show the diff even if the test step fails.

2. Consider more informative diff output

The bare git diff might be hard to read in CI logs. Consider:

- name: Show diff of changed files
  if: always()
  run: |
    echo "Files changed during test execution:"
    git diff --stat
    echo "Full diff:"
    git diff

3. Path handling appears Windows-ready

Good news: The codebase already uses path join extensively (toolkit.nu:39), which is the correct cross-platform approach in Nushell. The code appears well-prepared for Windows testing.

🧪 Test Coverage

The PR itself doesn't need additional tests - it's infrastructure change. However, the existing integration tests (toolkit.nu testing-integration) should validate Windows compatibility once this merges.

🔒 Security Considerations

No security concerns. The changes are limited to CI configuration with standard GitHub Actions patterns.

📝 Documentation

The PR description is clear and includes a test plan. Consider updating it to mention:

  • That the git diff step is intentionally informational (shouldn't block CI)
  • Expected differences between platforms (if any)

🎯 Final Recommendation

Approve with minor fix: This is a valuable addition. Please add if: always() or continue-on-error: true to the git diff step before merging to prevent false CI failures.

The expected non-zero diffs mentioned in CLAUDE.md (dynamic content like git tags, Nushell version differences) should be documented as potentially varying between OS platforms too.


Great work on improving cross-platform testing! 🚀

Add 'if: always()' condition to the git diff step to ensure it executes regardless of test results, making it easier to diagnose failures.

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude

claude Bot commented Dec 15, 2025

Copy link
Copy Markdown

Code Review: PR #97 - Add Windows CI Testing

Summary

This PR adds Windows testing to the CI pipeline using GitHub Actions matrix strategy. Overall, this is a well-structured improvement that will help ensure cross-platform compatibility for numd.


✅ Strengths

  1. Cross-platform testing is essential: The codebase already has Windows-specific handling (.github/workflows/ci.yml:23-24 - CRLF normalization, toolkit.nu:38 - path join for Windows compatibility), so testing on Windows is crucial.

  2. Good matrix strategy configuration: Using fail-fast: false is the right choice here - allows both OS tests to complete independently, providing full visibility into platform-specific issues.

  3. Helpful debugging addition: The git diff step with if: always() is useful for troubleshooting test failures, especially since integration tests modify files during execution.

  4. Minimal, focused change: Clean diff that doesn't introduce unnecessary complexity.


🔍 Observations & Recommendations

1. Git diff step might be noisy but acceptable

The git diff step will run even on successful builds due to if: always(). This could create noise in CI logs, but given that integration tests modify files (as documented in CLAUDE.md), this is actually helpful for verifying expected vs unexpected changes.

Recommendation: Consider adding a comment explaining why this step is useful:

      - name: Show diff of changed files
        if: always()
        # Integration tests modify example files - this helps verify expected changes
        run: git diff

2. Windows compatibility already partially addressed

The codebase shows awareness of Windows concerns:

  • numd/commands.nu:23-25: CRLF handling for Windows
  • toolkit.nu:38: Explicit comment about Windows path compatibility

However, there may be other Windows-specific issues to watch for:

  • Line ending handling in test assertions
  • Path separator issues beyond what path join handles
  • File permission differences
  • Temporary file handling differences

Recommendation: Monitor the first few Windows CI runs closely for these types of issues.

3. Test coverage consideration

The PR description mentions "Verify CI passes on Ubuntu" and "Verify CI passes on Windows" in the test plan, but these are unchecked.

Recommendation: Wait for at least one successful CI run on both platforms before merging.


🐛 Potential Issues

None identified. The changes are straightforward and well-implemented.


🔒 Security Concerns

None. This is a CI configuration change with no security implications.


⚡ Performance Considerations

Minor consideration: Running tests on both platforms will roughly double CI time. However, this is an acceptable trade-off for cross-platform reliability.

Current approach uses par-each --keep-order in integration tests (toolkit.nu:54), which should parallelize well on both platforms.


📊 Test Coverage

Good approach: The existing test suite already includes:

  • Unit tests via nutest (toolkit.nu testing-unit)
  • Integration tests on example markdown files (toolkit.nu testing-integration)
  • Both are run via toolkit.nu testing --json

These tests should provide good coverage for Windows compatibility issues.

Suggestion: Consider adding a Windows-specific test case in the future that explicitly tests:

  • CRLF vs LF handling
  • Windows path separators
  • Temp file handling

✨ Overall Assessment

Recommended for approval with minor suggestions above.

This is a valuable addition that aligns with the project's cross-platform goals. The implementation is clean, uses GitHub Actions best practices, and includes helpful debugging capabilities.

Before merging: Verify that CI passes on both platforms, paying special attention to any platform-specific failures in the integration tests.


Review generated with assistance from Claude Code

@maxim-uvarov
maxim-uvarov merged commit 0f6daaa into main Dec 15, 2025
3 checks passed
@maxim-uvarov
maxim-uvarov deleted the feat/win_ci branch December 15, 2025 22:47
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