Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ jobs:
timeout-minutes: 5
run: |
pip install . --no-deps --no-build-isolation
coverage run -a --omit="executorlib/_version.py,tests/*" -m unittest discover tests
coverage run -a
- name: Test Flux with OpenMPI
shell: bash -l {0}
timeout-minutes: 5
run: >
flux start
coverage run -a --omit="executorlib/_version.py,tests/*" -m unittest tests/test_fluxpythonspawner.py tests/test_fluxjobexecutor_plot.py tests/test_fluxjobexecutor.py tests/test_fluxclusterexecutor.py;
coverage run -a -m unittest tests/test_fluxpythonspawner.py tests/test_fluxjobexecutor_plot.py tests/test_fluxjobexecutor.py tests/test_fluxclusterexecutor.py;
coverage report;
coverage xml
env:
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@ packages = [
[tool.hatch.version]
source = "vcs"
path = "executorlib/_version.py"

[tool.coverage.run]
omit = ["executorlib/_version.py", "tests/*"]
Comment on lines +126 to +127
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Broaden test omit pattern to cover nested test packages.

The pattern tests/* only excludes files directly under tests/. It won’t omit nested paths like tests/benchmark/test_results.py. Use a recursive pattern if supported, or add additional globs.

Apply one of the following:

Option A (coverage >= 7 supports recursive globs):

 [tool.coverage.run]
-omit = ["executorlib/_version.py", "tests/*"]
+omit = ["executorlib/_version.py", "tests/**"]

Option B (portable without recursive globs):

 [tool.coverage.run]
-omit = ["executorlib/_version.py", "tests/*"]
+omit = [
+  "executorlib/_version.py",
+  "tests/*",
+  "tests/*/*",
+  "tests/*/*/*"
+]
🤖 Prompt for AI Agents
In pyproject.toml at lines 126 to 127, the omit pattern "tests/*" only excludes
files directly under the tests directory and misses nested test files. To fix
this, update the omit pattern to a recursive glob like "tests/**" if using
coverage version 7 or higher, or alternatively add multiple patterns to cover
nested directories for broader exclusion of test files.

command_line = "-m unittest discover tests"
Comment on lines +126 to +128
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Constrain coverage to project source to avoid noise from dependencies.

Without a source setting, coverage can record any traced files, potentially including third-party modules. It’s best practice to target the package.

 [tool.coverage.run]
+source = ["executorlib"]
 omit = ["executorlib/_version.py", "tests/*"]
 command_line = "-m unittest discover tests"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[tool.coverage.run]
omit = ["executorlib/_version.py", "tests/*"]
command_line = "-m unittest discover tests"
[tool.coverage.run]
source = ["executorlib"]
omit = ["executorlib/_version.py", "tests/*"]
command_line = "-m unittest discover tests"
🤖 Prompt for AI Agents
In pyproject.toml around lines 126 to 128, the coverage configuration lacks a
'source' setting, causing coverage to include files outside the project like
dependencies. Add a 'source' key under [tool.coverage.run] specifying the
project package or source directory to limit coverage measurement to your own
code and avoid noise from third-party modules.

Loading