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
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
test:
name: Test Python code
runs-on: ubuntu-latest
env:
# add API token to `CODACY_PROJECT_TOKEN` action secrets
# NOTE: secrets aren't available to Dependabot or fork pull requests
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/preparation
Expand All @@ -25,12 +29,11 @@ jobs:
name: coverage-report
path: htmlcov

# add API token to `CODACY_PROJECT_TOKEN` action secrets
- name: Generate XML Coverage Report
if: env.CODACY_PROJECT_TOKEN != ''
run: uv run coverage xml
- name: Submit Coverage Report
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
if: env.CODACY_PROJECT_TOKEN != ''
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml

smoke-test:
Expand Down
7 changes: 4 additions & 3 deletions src/tasktronaut/backends/rq.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ def enqueue_jobs(self, job_ids: List[str]) -> List[rq.job.Job]:
pipe.unwatch()
continue

status = cast(
Optional[Union[bytes, str]], pipe.hget(job.key, "status")
)
status = pipe.hget(job.key, "status")
# NOTE: `isinstance` narrows the type of `status` for both the
# loosely (redis < 8) and precisely (redis >= 8) typed `hget`
if (
not status
or not isinstance(status, (bytes, str))
or JobStatus(as_text(status)) != JobStatus.READY_TO_ENQUEUE
):
pipe.multi()
Expand Down
Loading