Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support debug mode for experimental_test_shell_command target type #21957

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

tdyas
Copy link
Contributor

@tdyas tdyas commented Feb 14, 2025

Support debug mode for the experimental_test_shell_command target type so that users can execute the tests in interactive mode.


return TestDebugRequest(
InteractiveProcess.from_process(
shell_process, forward_signals_to_process=False, restartable=True
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a question about pants test --debug in general: Should restartable be configurable somehow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It's occasionally annoying if I forget that --debug restarts on file change, and so I make a few edits, save, and find my in-progress debugging session interrupted.

I don't know if I'd remember to pass an extra flag like pants test --debug --no-debug-restart or whatever.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe such a flag should be specific to the kind of test then (and then configured in pants.toml)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In any event, going to land this PR since I'm just matching existing behavior of our test --debug impls here.

Copy link
Contributor

@huonw huonw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Good idea!


return TestDebugRequest(
InteractiveProcess.from_process(
shell_process, forward_signals_to_process=False, restartable=True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question. It's occasionally annoying if I forget that --debug restarts on file change, and so I make a few edits, save, and find my in-progress debugging session interrupted.

I don't know if I'd remember to pass an extra flag like pants test --debug --no-debug-restart or whatever.

@tdyas tdyas merged commit 39b063c into pantsbuild:main Feb 17, 2025
24 checks passed
@tdyas tdyas deleted the shell/debug_for_test_shell_command branch February 17, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants