Skip to content

Fix interactive execution of integration tests#42

Merged
soniapi merged 1 commit intolibfrom
fix-interactive-integration-test-5341466632526390579
Mar 30, 2026
Merged

Fix interactive execution of integration tests#42
soniapi merged 1 commit intolibfrom
fix-interactive-integration-test-5341466632526390579

Conversation

@soniapi
Copy link
Copy Markdown
Owner

@soniapi soniapi commented Mar 30, 2026

This PR modifies tests/integration_test.rs to allow the integration test to be run interactively.

Problem:
The integration test aggressively mocks stdin using libc::dup2 by default. This causes any manual attempts to run the test and provide terminal inputs to immediately fall through, as the file descriptors have already been pointed to a temporary file containing pre-filled string data ("1\n180000.0\n").

Solution:
Wrapped the standard input mocking block inside an environment variable check (std::env::var("INTERACTIVE").is_err()).

Now, when run with cargo test (like in CI/CD pipelines), INTERACTIVE won't be set, and it will silently mock stdin as it did before.

If a user wishes to run the test manually, they can now execute:
INTERACTIVE=1 cargo test -- --nocapture

And the test will correctly wait for them to type 1 and 180000.0 into the terminal.


PR created automatically by Jules for task 5341466632526390579 started by @soniapi

@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

By default, the integration test overwrites `stdin` with a mock file using `libc::dup2` to prevent tests from hanging on user input prompts. This commit introduces a check against the `INTERACTIVE` environment variable. If set, the test will skip mocking `stdin`, allowing developers to run `INTERACTIVE=1 cargo test -- --nocapture` and manually input values to the CLI prompts.

Co-authored-by: soniapi <396009+soniapi@users.noreply.github.com>
@soniapi soniapi force-pushed the fix-interactive-integration-test-5341466632526390579 branch from ee2a270 to 97cf889 Compare March 30, 2026 01:36
@soniapi soniapi merged commit ad47dfb into lib Mar 30, 2026
1 check passed
@soniapi soniapi deleted the fix-interactive-integration-test-5341466632526390579 branch March 30, 2026 01:41
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.

1 participant