Skip to content

Several small bugfix#494

Open
gpetretto wants to merge 1 commit into
developfrom
gp/bugfix
Open

Several small bugfix#494
gpetretto wants to merge 1 commit into
developfrom
gp/bugfix

Conversation

@gpetretto

Copy link
Copy Markdown
Contributor

Fix for several bugs identified by AI. Mostly harmless (text format or in functions not used anymore) or with impact only in limited corner cases.

@codecov-commenter

codecov-commenter commented Jun 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.69231% with 33 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.95%. Comparing base (d74e892) to head (306288d).

Files with missing lines Patch % Lines
src/jobflow_remote/utils/db.py 42.85% 10 Missing and 2 partials ⚠️
src/jobflow_remote/cli/utils.py 57.69% 6 Missing and 5 partials ⚠️
src/jobflow_remote/remote/data.py 0.00% 2 Missing and 1 partial ⚠️
src/jobflow_remote/cli/admin.py 60.00% 2 Missing ⚠️
src/jobflow_remote/jobs/daemon.py 33.33% 1 Missing and 1 partial ⚠️
src/jobflow_remote/utils/remote.py 66.66% 1 Missing and 1 partial ⚠️
src/jobflow_remote/jobs/jobcontroller.py 87.50% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #494      +/-   ##
===========================================
- Coverage    76.01%   75.95%   -0.06%     
===========================================
  Files           52       52              
  Lines         8204     8221      +17     
  Branches      1361     1366       +5     
===========================================
+ Hits          6236     6244       +8     
- Misses        1524     1533       +9     
  Partials       444      444              
Flag Coverage Δ
all_local_tests 75.75% <57.69%> (-0.06%) ⬇️
all_tests 75.95% <57.69%> (-0.06%) ⬇️
db_tests 71.54% <55.12%> (-0.06%) ⬇️
integration_local_tests 45.68% <6.41%> (-0.08%) ⬇️
integration_remote_tests 26.03% <2.56%> (-0.03%) ⬇️
integration_tests 46.55% <6.41%> (-0.08%) ⬇️
unit_tests 27.16% <2.56%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/jobflow_remote/cli/batch.py 96.29% <ø> (ø)
src/jobflow_remote/cli/flow.py 76.27% <100.00%> (+0.46%) ⬆️
src/jobflow_remote/cli/job.py 85.18% <100.00%> (ø)
src/jobflow_remote/cli/runner.py 76.61% <ø> (ø)
src/jobflow_remote/jobs/run.py 74.19% <ø> (ø)
src/jobflow_remote/jobs/runner.py 78.96% <100.00%> (ø)
src/jobflow_remote/jobs/jobcontroller.py 81.63% <87.50%> (ø)
src/jobflow_remote/cli/admin.py 89.72% <60.00%> (+0.76%) ⬆️
src/jobflow_remote/jobs/daemon.py 67.42% <33.33%> (+0.20%) ⬆️
src/jobflow_remote/utils/remote.py 81.25% <66.66%> (+2.91%) ⬆️
... and 3 more

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@davidwaroquiers davidwaroquiers left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Almost all good to me! You can go ahead after checking if what I reviewed is reasonable :)

Comment on lines +57 to +74
cls = self.__class__
if cls._ref_count == 0:
# No context is currently active: this is (or precedes) the
# outermost context, so (re)bind to the requested project,
# discarding any project left over from a previous operation.
if project is None:
config_manager: ConfigManager = ConfigManager()
project = config_manager.get_project(None)
self._project = project
cls._project = project
elif project is not None and project.name != cls._project.name:
# A context is already open and bound to another project. Sharing
# host connections across projects is not supported, so refuse
# instead of silently using the wrong project's workers.
raise ValueError(
f"SharedHosts is already active for project '{cls._project.name}' "
f"and cannot be used for a different project ('{project.name}') "
"at the same time."
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need to have a test for this maybe ?

Comment on lines 204 to +208
for k, v in d.items():
if v:
not_none.append(k)

if len(not_none) > 1:
if len(not_none) <= 1:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here it should be < 1 no ? Also, I don't remember if an empty string can be a meaningful value for a given option, in which case the "if v:" should rather be "if v is not None:" (but I have the feeling that an empty string is not a meaningful value/possible thing in the cli ?)

Comment on lines +805 to +817
add2_info = job_controller.get_job_info(add2.uuid)
assert (
len(
job_controller.delete_jobs(
job_ids=[(add2.uuid, 1)], delete_output=True, delete_files=True
)
)
== 1
)
with pytest.raises(ValueError, match=".*has no outputs.*"):
job_controller.jobstore.get_output(add2.uuid)

assert not os.path.isdir(add2_info.run_dir)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does it need to check that get_output has something before the deletion and the run_dir exists before the deletion ?

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.

3 participants