test-script
Use when writing or modifying .txt test scripts in testdata/script/ for git-spice - covers txtar format, end-to-end testing, ShamHub forge simulation, interactive prompts, and golden file comparisons for branch operations and stack workflows.
Security Assessment
About test-script
The 'test-script' skill is designed to facilitate the creation, modification, and execution of test scripts for the git-spice tool. It primarily handles scripts in '.txt' format, adhering to the txtar format, to validate the functionality of git-spice commands. The skill ensures that users can verify end-to-end processes, interact with ShamHub simulations, perform golden file comparisons, and test specific branch operations or stack workflows. By using this skill, users can automate the testing of various git-spice functionalities and ensure system integrity during development or deployment phases.
This skill offers several key capabilities for git-spice testing, including running tests with a focus on interactive prompts, branch creation, and repository initialization. The test scripts allow for easy comparison between actual and expected outputs, using predefined golden files, and can simulate real-world interactions with ShamHub for forge-based testing. This makes it an essential tool for developers and testers who are working with git-spice, particularly those focused on end-to-end testing or automating continuous integration pipelines. Whether you're creating new tests, updating existing ones, or ensuring compatibility with new features, this skill provides a robust solution for comprehensive testing.
FAQ
How do I run a specific test using the test-script skill?
You can run a specific test by using the command: `mise run test:script --run $name` where `$name` is the name of the test script you want to execute.
Can I use shell operations like `>` or `>>` in my test scripts?
No, the test-script skill does not support shell operations such as `>`, `>>`, `2>`, `|`, or command substitution. You should use alternatives like `cmp stdout`, `cmp stderr`, `stdout`, or `stderr`.
Are there any specific requirements for deterministic Git hashes in test scripts?
Yes, to ensure consistent Git SHAs across test runs, always freeze time and author at the start of the script using the `as` and `at` commands.
What are the limitations when working with ShamHub in the test scripts?
ShamHub is only required for tests involving forge interactions. It is not needed for basic tests that do not involve Git-based forge operations.
How should I structure the naming of my test scripts?
Test scripts should follow the naming convention `<command>_<scenario>.txt`, where `<command>` is the git-spice command being tested in snake_case, and `<scenario>` describes the specific test case.
Install test-script
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
abhinav/git-spice