Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 20, 2026

Plan: Rewrite Tests in Python and Add Multi-Platform Support

  • Analyze current BATS test structure in tests.bat
  • Create Python test framework using unittest
  • Rewrite test cases from BATS to Python
    • Test: ensuring .meta is committed
    • Test: ignoring assets file which starts with dot
    • Test: renaming directory
  • Add cross-platform support for test execution
    • Ensure tests work on macOS
    • Ensure tests work on Windows with PowerShell
    • Handle git execution via Scoop mingit on Windows
  • Update CI workflow to test on multiple platforms
    • Add macOS runner
    • Add Windows runner with Scoop mingit setup
  • Create test runner script for local testing
  • Update documentation with new test instructions
  • Update README.md with testing section
  • Make git run hooks automatically instead of manually
  • Delete TESTING.md per requirement
  • All tests passing locally
  • Remove useless chmod step from workflow
  • Delete old bats workflow file
  • Fix Windows CI failure (PermissionError in tearDown)
  • Delete deprecated tests.bat file

Summary

Successfully rewrote the test suite from BATS to Python with the following improvements:

  1. Cross-platform support: Tests now work on Linux, macOS, and Windows
  2. Automatic hook execution: Git runs hooks automatically during commits (not manual execution)
  3. Windows Scoop mingit support: Tests handle git installed via Scoop mingit on Windows
  4. GitHub Actions CI: Multi-platform testing workflow for ubuntu-latest, macos-latest, and windows-latest
  5. Clean implementation: All 3 test cases passing with realistic git workflow simulation
  6. Removed unnecessary steps: Cleaned up workflow by removing chmod step (Python doesn't require executable flag)
  7. Removed old BATS files: Deleted deprecated bats.yml workflow and tests.bat file
  8. Windows file permission handling: Fixed tearDown to handle Windows readonly git objects
Original prompt

Test hooks for macOS and Windows. Rewrite tests in Python. In Windows, Use PowerShell to execute git installed via Scoop mingit package.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits January 20, 2026 15:57
Co-authored-by: doitian <35768+doitian@users.noreply.github.com>
Co-authored-by: doitian <35768+doitian@users.noreply.github.com>
Co-authored-by: doitian <35768+doitian@users.noreply.github.com>
@doitian doitian marked this pull request as ready for review January 20, 2026 16:01
Copilot AI changed the title [WIP] Rewrite test hooks for macOS and Windows in Python Rewrite tests in Python with cross-platform support Jan 20, 2026
Copilot AI requested a review from doitian January 20, 2026 16:04
@doitian
Copy link
Owner

doitian commented Jan 20, 2026

@copilot .github/workflows/test-hooks.yml:48-51 useless step

Co-authored-by: doitian <35768+doitian@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 20, 2026

@copilot .github/workflows/test-hooks.yml:48-51 useless step

Removed in e0455da. Python doesn't need the executable flag to run with python test_hooks.py.

@doitian
Copy link
Owner

doitian commented Jan 20, 2026

@copilot Delete tests.bat

Co-authored-by: doitian <35768+doitian@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 20, 2026

@copilot Delete tests.bat

Deleted in 86d0d2d. Also fixed the Windows CI failure caused by PermissionError when cleaning up git object files.

@doitian doitian merged commit 3e91c88 into master Jan 20, 2026
3 checks passed
@doitian doitian deleted the copilot/test-hooks-python-rewrite branch January 20, 2026 16:13
Copilot stopped work on behalf of doitian due to an error January 20, 2026 16:13
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