1
0
Fork 0
mirror of https://github.com/imjasonh/testscript-rs synced 2026-07-08 17:16:38 +00:00
testscript-rs/tests
Copilot 6b5a64703f
Add WorkdirRoot configuration for custom work directories (#27)
- [x] Add `workdir_root` field to `RunParams` struct
- [x] Add `workdir_root` method to `Builder` API  
- [x] Modify `TestEnvironment::new()` to accept optional root directory
- [x] Update `TestEnvironment::new()` to use
`tempfile::TempDir::new_in()` when root is specified
- [x] Add validation for root directory existence and writability
- [x] Add tests for the new workdir_root functionality
- [x] Update documentation and examples
- [x] Address PR feedback: remove unnecessary files and improve tests
- [x] Fix code formatting with cargo fmt
- [x] Add rustfmt.toml configuration and update CLAUDE.md
- [x] Improve basic test to verify actual workdir usage

## Recent Changes

**Enhanced basic functionality test:**
- Modified `test_workdir_root_basic_functionality` to induce a failure
and use `preserve_work_on_failure(true)`
- Test now verifies that the workdir was actually created in the custom
root directory
- Validates that test files exist in the preserved workdir with expected
content
- **Removed** redundant `test_workdir_root_with_preserve_work` test as
the functionality is now covered by the improved basic test

The test suite is now more meaningful and comprehensive, with 4 focused
tests that provide real validation of the workdir_root functionality:
- Basic functionality with actual workdir verification
- Error handling for nonexistent directories  
- Error handling for non-directory paths
- API chaining validation

All tests pass and the implementation properly validates that custom
workdir roots are used as expected.

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: imjasonh <210737+imjasonh@users.noreply.github.com>
Co-authored-by: Jason Hall <jason@chainguard.dev>
2025-09-30 06:57:10 +00:00
..
advanced_conditions.rs Add network and advanced condition support with automatic detection and CI optimization (#21) 2025-09-27 17:00:36 +00:00
builtin_commands.rs Fix symlink command implementation and add comprehensive tests (#22) 2025-09-27 03:41:07 +00:00
edge_cases.rs Refactor run module into modular structure (#18) 2025-09-27 01:17:45 +00:00
error_messages.rs
integration.rs
preserve_work.rs Add TestWork functionality to preserve working directories on failure (#24) 2025-09-27 19:03:10 +00:00
setup_hook.rs
update_scripts.rs Add UpdateScripts functionality for test maintenance (#20) 2025-09-26 21:47:09 -04:00
workdir_root.rs Add WorkdirRoot configuration for custom work directories (#27) 2025-09-30 06:57:10 +00:00