Skip to content

Improve scheduler coverage for AWS Batch and MPI edge/error paths#351

Draft
Copilot wants to merge 7 commits into
mainfrom
copilot/analyze-test-coverage
Draft

Improve scheduler coverage for AWS Batch and MPI edge/error paths#351
Copilot wants to merge 7 commits into
mainfrom
copilot/analyze-test-coverage

Conversation

Copilot AI commented May 11, 2026

Copy link
Copy Markdown
Contributor

This PR targets uncovered scheduler branches identified during coverage analysis, focusing on failure and boundary behavior that was not exercised by existing tests. It adds focused unit tests for AWS Batch array metadata/index handling and MPI scheduler initialization/work allocation edge cases.

  • Coverage gaps addressed

    • Added explicit tests for AWSBatchArrayScheduler error paths:
      • missing arrayProperties.size in AWS Batch parent job metadata
      • non-integer AWS_BATCH_JOB_ARRAY_INDEX
    • Added explicit tests for MPIScheduler edge behavior:
      • mismatch between shared_vars and initializer return size
      • rank with no assigned items returns an empty index list
  • Test isolation improvements

    • Added a resilient symbol loader in the new test module to import scheduler/constants directly from source when package-level imports are unavailable in lightweight environments.
    • Kept assertions specific to expected exception classes/messages to ensure the tests validate the intended branches.
  • New test module

    • tests/test_scheduler_additional.py

Example of one of the added edge-case checks:

with pytest.raises(ValueError, match="invalid literal for int\\(\\)"):
    AWSBatchArrayScheduler().get_indices([1, 2, 3, 4])

Copilot AI and others added 7 commits May 11, 2026 21:27
Agent-Logs-Url: https://github.com/noisepy/NoisePy/sessions/b7d23d73-d5e2-4782-9e78-9d9acfa30b3c

Co-authored-by: niyiyu <36231703+niyiyu@users.noreply.github.com>
Agent-Logs-Url: https://github.com/noisepy/NoisePy/sessions/b7d23d73-d5e2-4782-9e78-9d9acfa30b3c

Co-authored-by: niyiyu <36231703+niyiyu@users.noreply.github.com>
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.

2 participants