Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gpetretto committed Mar 15, 2024
1 parent 42e6fae commit ae86d38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ jobs:
pip install .[tests]
- name: Unit tests
run: pytest --cov=jobflow_remote --cov-report=xml --ignore tests/integration
run: pytest --cov=jobflow_remote --cov-report=xml --cov-config pyproject.toml --ignore tests/integration

- name: Integration tests
run: pytest --cov=jobflow_remote --cov-append --cov-report=xml tests/integration
run: pytest --cov=jobflow_remote --cov-append --cov-report=xml --cov-config pyproject.toml tests/integration

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand Down
10 changes: 5 additions & 5 deletions src/jobflow_remote/jobs/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ def run_all_jobs(
JobState.BATCH_SUBMITTED.value,
]
query = {"state": {"$in": running_states}}
jobs_available = True
jobs_available = 1
while jobs_available:
scheduler.run_pending()
time.sleep(0.2)
Expand All @@ -385,7 +385,7 @@ def run_all_jobs(
def run_one_job(
self,
db_id: str | None = None,
job_id: tuple[str, str] | None = None,
job_id: tuple[str, int] | None = None,
max_seconds: int | None = None,
raise_at_timeout: bool = True,
) -> bool:
Expand All @@ -405,7 +405,7 @@ def run_one_job(
scheduler = SafeScheduler(seconds_after_failure=120)

t0 = time.time()
query = {}
query: dict = {}
if db_id:
query["db_id"] = db_id
if job_id:
Expand All @@ -414,12 +414,12 @@ def run_one_job(
job_data = self.job_controller.checkout_job(query=query)
if not job_data:
if not db_id and not job_id:
return None
return False
elif not db_id:
job_data = job_id
else:
j_info = self.job_controller.get_job_info(db_id=db_id)
job_data = [j_info.uuid, j_info.index]
job_data = (j_info.uuid, j_info.index)

filter = {"uuid": job_data[0], "index": job_data[1]}
self.advance_state(states)
Expand Down

0 comments on commit ae86d38

Please sign in to comment.