Closed
Conversation
Member
|
Check with your AI or answer the questions using your own research; we won't be promting your AI for you. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi maintainers,
This PR is a work-in-progress draft to improve the CLI experience for running GRASS tools. It includes the following changes:
Added --region support to the run subcommand:
Allows users to temporarily set a computational region (e.g., raster map) before running a tool.
Initial tests for subcommand_run_tool using mocks:
test_run_tool_with_region checks that g.region is called when --region is provided.
test_run_tool_without_region ensures g.region is not called when the option is omitted.
All tests mock GRASS binaries to avoid requiring a full GRASS session.
Notes / Guidance Requested.
The mocks allow the tests to run without setting up a full GRASS environment, but I’m not sure if this aligns with project standards.
Should I replace these with integration-style tests once a GRASS session is available?
Any recommendations on how to structure or extend these tests for coverage of other CLI features would be greatly appreciated.
This PR is explicitly draft/WIP; the goal is to get feedback on the approach before finalizing tests or merging.
Verified both test_run_tool_with_region and test_run_tool_without_region run successfully with mocks.
Existing CLI tests (--help, man, regular tool runs) continue to pass.
Next steps (after feedback)
Potentially add full integration tests using a live GRASS session.
Refactor mocks if needed.
Expand tests for other flags or tools in the CLI.