Skip to content

🧪 [Add tests for bionetgen.modelapi.runner.run] - #102

Merged
akutuva21 merged 2 commits into
mainfrom
testing-improvement-runner-15698129411844816542
Apr 13, 2026
Merged

akutuva21 merged 2 commits into
mainfrom
testing-improvement-runner-15698129411844816542

Conversation

@akutuva21

Copy link
Copy Markdown
Owner

🎯 What: The testing gap addressed
This PR provides test coverage for the previously untested run function in bionetgen.modelapi.runner.py. The run function acts as a wrapper around the BNGCLI object. Additionally, some test dependencies that were completely broken in Python 3.12 due to the removal of distutils were patched to fallback to standard libraries (shutil), enabling the test suite to run.

📊 Coverage: What scenarios are now tested

  1. Calling run(inp, out=...) explicitly with an output directory.
  2. Calling run(inp) without providing an output directory, testing the temp dir context logic.
  3. Simulating an exception during cli.run(), ensuring that os.chdir() cleans up the working directory and the exception is appropriately raised.

✨ Result: The improvement in test coverage
The core flow of the modelapi.runner.run utility is now robustly tested, safeguarding against regressions. Additionally, the test suite is now significantly more robust to run in modern Python >=3.12 versions.


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

- Implemented tests using `unittest.mock` to stub out `BNGCLI` and `TemporaryDirectory`.
- Added tests covering happy path (with out dir, without out dir) and exception flow.
- Added a compatibility fix in `csimulator.py` and `utils.py` for Python 3.12, replacing `distutils` with standard library equivalents (`shutil`).

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.

@akutuva21
akutuva21 merged commit 7b29521 into main Apr 13, 2026
14 of 18 checks passed
@akutuva21
akutuva21 deleted the testing-improvement-runner-15698129411844816542 branch April 13, 2026 14:26
akutuva21 pushed a commit that referenced this pull request Jun 5, 2026
Optional BNGsim integration: in-process simulation + multi-format input
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