Skip to content

🧪 Bolt: Add missing unit tests for runner.run function - #43

Closed
akutuva21 wants to merge 3 commits into
mainfrom
bolt/test-runner-run-function-11391169183500655460
Closed

akutuva21 wants to merge 3 commits into
mainfrom
bolt/test-runner-run-function-11391169183500655460

Conversation

@akutuva21

Copy link
Copy Markdown
Owner

🎯 What: This PR introduces a new test file tests/test_runner.py containing comprehensive unit tests for the runner.run() function in bionetgen/modelapi/runner.py. The run function lacked test coverage despite being the primary entry point for executing BNG2.pl as a library.

📊 Coverage: The tests use unittest.mock to mock out BNGCLI, os.chdir, and TemporaryDirectory, providing safe, deterministic test coverage for the following scenarios:

  1. run called with a specified out directory.
  2. run called without an out directory, correctly falling back to generating a temporary directory.
  3. Correct exception re-raising and working directory cleanup when BNGCLI.run() raises an exception with an out directory.
  4. Correct exception re-raising and working directory cleanup when BNGCLI.run() raises an exception using a temporary directory.

✨ Result: The test coverage for the bionetgen/modelapi/runner.py module is significantly improved. Future refactoring can proceed with confidence that the core execution and fallback logic is protected by automated tests.


PR created automatically by Jules for task 11391169183500655460 started by @akutuva21

Adds a comprehensive test suite to cover the core scenarios of the `runner.run()` function in `bionetgen/modelapi/runner.py`. The tests verify proper argument delegation to `BNGCLI` and correctly test output folder creation using temp directories and exception handling while isolating external effects using `unittest.mock`.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 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.

google-labs-jules Bot and others added 2 commits April 9, 2026 20:02
Adds a comprehensive test suite to cover the core scenarios of the `runner.run()` function in `bionetgen/modelapi/runner.py`. The tests verify proper argument delegation to `BNGCLI` and correctly test output folder creation using temp directories and exception handling while isolating external effects using `unittest.mock`. Fixes Black formatting issues as per CI requirements.

Co-authored-by: akutuva21 <44119804+akutuva21@users.noreply.github.com>
@akutuva21

Copy link
Copy Markdown
Owner Author

Superseded by merged #102 runner tests.

@akutuva21 akutuva21 closed this Apr 13, 2026
@google-labs-jules

Copy link
Copy Markdown

Superseded by merged #102 runner tests.

Understood. Acknowledging that this work is superseded and stopping work on this task.

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