Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d9282f3
fix: update secret variable names in jira_cloud_ci.yml
studioj Sep 13, 2025
956c784
test: add `@allow_on_cloud` decorator to `test_create_and_delete` in …
studioj Sep 13, 2025
a96e2df
fix: update trigger conditions and ref logic in jira_cloud_ci.yml
studioj Sep 13, 2025
932b8fa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 13, 2025
fb14d6c
test: add `@allow_on_cloud` decorator to multiple comment tests in Co…
studioj Sep 13, 2025
77c7326
test: add `@allow_on_cloud` decorator to multiple component tests in …
studioj Sep 13, 2025
e4df15b
test: add `@allow_on_cloud` decorator to `test_custom_field_option` i…
studioj Sep 13, 2025
83489ad
test: add `@allow_on_cloud` decorator to multiple epic tests in EpicT…
studioj Sep 13, 2025
d056b6b
test: add `@allow_on_cloud` decorator to multiple filter tests in Fil…
studioj Sep 13, 2025
bed921f
test: add `@allow_on_cloud` decorator to `test_cls_for_resource` in G…
studioj Sep 13, 2025
579dc0f
test: add `@allow_on_cloud` decorator to IssueTests
studioj Sep 13, 2025
020c7f0
test: handle cloud-specific behavior in `test_issue_property`
studioj Sep 13, 2025
1b95bf4
test: add delays in rank tests to avoid race conditions
studioj Sep 13, 2025
d71809a
test: add `@allow_on_cloud` decorator to PrioritiesTests
studioj Sep 13, 2025
b20df4b
test: add `@allow_on_cloud` decorator to ProjectTests
studioj Sep 13, 2025
4f64b54
test: add `@allow_on_cloud` decorator to ProjectStatusesByIssueTypeTests
studioj Sep 13, 2025
b9d268e
test: add `@allow_on_cloud` decorator to RemoteLinkTests
studioj Sep 13, 2025
c35d35f
test: add `@allow_on_cloud` decorator to ResolutionTests
studioj Sep 13, 2025
43f15eb
test: make delays in IssueTests cloud-aware to handle timing differences
studioj Sep 13, 2025
6695860
test: add delays and suppress exceptions in DashboardTests to improve…
studioj Sep 13, 2025
59153c3
test: adjust sleeptime in IssueTests for cloud environment stability
studioj Sep 13, 2025
487f9c0
test: add `@allow_on_cloud` decorator to SprintTests
studioj Sep 13, 2025
424d163
test: add `@allow_on_cloud` decorator to StatusTests
studioj Sep 13, 2025
b864bce
test: add `@allow_on_cloud` decorator to StatusCategoryTests
studioj Sep 13, 2025
2c3292b
test: add `@allow_on_cloud` decorator to UserTests
studioj Sep 13, 2025
614613b
test: add `@allow_on_cloud` decorator to VersionTests
studioj Sep 13, 2025
817fa02
test: add `@allow_on_cloud` decorator to VoteTests
studioj Sep 13, 2025
14b7a8f
test: update sprint field assertion in test_sprint.py
studioj Sep 13, 2025
2d03630
test: rename test methods in test_exceptions.py for running as unittest
studioj Sep 13, 2025
ec73bcf
test: add `@allow_on_cloud` decorator to ClientTests
studioj Sep 13, 2025
2bd86f0
test: remove `@allow_on_cloud` decorator from ClientTests and adjust …
studioj Sep 13, 2025
ac45c64
test: add `@allow_on_cloud` decorator to ResilientSessionTests and re…
studioj Sep 13, 2025
6c8e2f9
ci: enable testing on multiple Python versions and simplify ref handling
studioj Nov 5, 2025
973ab9e
ci: restrict Python version to 3.10 for testing in CI pipeline
studioj Nov 5, 2025
cee2393
ci: update CI pipeline to install necessary package dependencies
studioj Nov 5, 2025
8214809
ci: swap to use tox gh actions instead of the archived coactions dyna…
studioj Nov 5, 2025
1360218
ci: swap to use tox gh actions instead of the archived coactions dyna…
studioj Nov 5, 2025
4637f5d
ci: swap to use tox gh actions instead of the archived coactions dyna…
studioj Nov 5, 2025
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
16 changes: 9 additions & 7 deletions .github/workflows/jira_cloud_ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: cloud

on:
pull_request:
workflow_call:
inputs:
ref:
Expand Down Expand Up @@ -32,14 +33,15 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
# We only test a single version to prevent concurrent
# running of tests influencing one another
python-version: ["3.10"]
concurrency:
group: jira-cloud-tests
cancel-in-progress: false

steps:
- uses: actions/checkout@v5
with:
ref: ${{ github.event.inputs.ref }}
ref: ${{ github.ref }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
Expand All @@ -57,10 +59,10 @@ jobs:
run: tox run -e py310 -- -m allow_on_cloud
env:
CI_JIRA_TYPE: CLOUD
CI_JIRA_CLOUD_ADMIN: ${{ secrets.CLOUD_ADMIN }}
CI_JIRA_CLOUD_ADMIN_TOKEN: ${{ secrets.CLOUD_ADMIN_TOKEN }}
CI_JIRA_CLOUD_USER: ${{ secrets.CLOUD_USER }}
CI_JIRA_CLOUD_USER_TOKEN: ${{ secrets.CLOUD_USER_TOKEN }}
CI_JIRA_CLOUD_ADMIN: ${{ secrets.CI_JIRA_CLOUD_ADMIN }}
CI_JIRA_CLOUD_ADMIN_TOKEN: ${{ secrets.CI_JIRA_CLOUD_ADMIN_TOKEN }}
CI_JIRA_CLOUD_USER: ${{ secrets.CI_JIRA_CLOUD_USER }}
CI_JIRA_CLOUD_USER_TOKEN: ${{ secrets.CI_JIRA_CLOUD_USER_TOKEN }}

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand Down
219 changes: 24 additions & 195 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -1,206 +1,35 @@
---
name: tox
on:
merge_group:
branches:
- "main"
push:
branches:
- "main"
pull_request:
branches:
- "main"
schedule:
- cron: "0 0 * * *"
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
name: Tox

env:
FORCE_COLOR: 1 # tox, pytest
PY_COLORS: 1
on:
- pull_request

jobs:
prepare:
name: prepare
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.generate_matrix.outputs.matrix }}
steps:
- name: Determine matrix
id: generate_matrix
uses: coactions/dynamic-matrix@v4
with:
min_python: "3.10"
max_python: "3.12"
default_python: "3.10"
other_names: |
lint
docs
pkg
devel:tox -e devel -- -k test_unit
py310:tox -e py310 -- -k test_unit
py311:tox -e py311 -- -k test_unit
py312:tox -e py312 -- -k test_unit
py310-macos:tox -e py310 -- -k test_unit
py312-macos:tox -e py312 -- -k test_unit
# ^ macos is also used to validate arm64 building
platforms: linux,macos
skip_explode: "1"
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os || 'ubuntu-24.04' }}
needs:
- prepare
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
steps:

- name: Install package dependencies (ubuntu)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo apt remove -y docker-compose
sudo apt-get update -y
sudo apt-get --assume-yes --no-install-recommends install -y apt-transport-https curl libkrb5-dev

- uses: actions/checkout@v5
with:
fetch-depth: 0 # needed by setuptools-scm
submodules: true

- name: Set pre-commit cache
uses: actions/cache@v4
if: ${{ contains(matrix.name, 'lint') }}
with:
path: |
~/.cache/pre-commit
key: pre-commit-${{ matrix.name }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Set up Python ${{ matrix.python_version || '3.10' }}
uses: actions/setup-python@v6
with:
cache: pip
python-version: ${{ matrix.python_version || '3.10' }}
cache-dependency-path: "*requirements*.txt"

- name: Install tox
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade "tox>=4.0.0" "tox-uv>=1.25.0" "uv>=0.6.6"

- run: ${{ matrix.command }}

- run: ${{ matrix.command2 }}
if: ${{ matrix.command2 }}

- run: ${{ matrix.command3 }}
if: ${{ matrix.command3 }}

- run: ${{ matrix.command4 }}
if: ${{ matrix.command4 }}

- run: ${{ matrix.command5 }}
if: ${{ matrix.command5 }}

- name: Archive logs
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.name }}.zip
include-hidden-files: true
path: |
.tox/**/log/
.tox/**/.coverage*
.tox/**/coverage.xml

- name: Report failure if git reports dirty status
run: |
if [[ -n $(git status -s) ]]; then
# shellcheck disable=SC2016
echo -n '::error file=git-status::'
printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY"
exit 99
fi
# https://github.com/actions/toolkit/issues/193
check:
if: always()
environment: check
permissions:
id-token: write
checks: read

needs:
- build

runs-on: ubuntu-24.04
matrix:
include:
- python-version: '3.10'
tox-env: 'py310'
# - python-version: '3.11'
# tox-env: 'py311'
# - python-version: '3.12'
# tox-env: 'py312'

steps:
# checkout needed for codecov action which needs codecov.yml file
- uses: actions/checkout@v5

- name: Set up Python # likely needed for coverage
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: "3.12"

- run: pip3 install 'coverage>=7.5.1'

- name: Merge logs into a single archive
uses: actions/upload-artifact/merge@v4
with:
name: logs.zip
include-hidden-files: true
pattern: logs-*.zip
# artifacts like py312.zip and py312-macos do have overlapping files
separate-directories: true

- name: Download artifacts
uses: actions/download-artifact@v5
continue-on-error: true # to allow rerunning this job
with:
name: logs.zip
path: .

- name: Check for expected number of coverage.xml reports
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
JOBS_PRODUCING_COVERAGE=5
if [ "$(find . -name coverage.xml | wc -l | bc)" -ne "${JOBS_PRODUCING_COVERAGE}" ]; then
echo "::error::Number of coverage.xml files was not the expected one (${JOBS_PRODUCING_COVERAGE}): $(find . -name coverage.xml |xargs echo)"
exit 1
fi

# Single uploads inside check job for codecov to allow use to retry
# it when it fails without running tests again. Fails often enough!
- name: Upload junit xml reports
# PRs from forks might not have access to the secret
if: env.CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN || env.CODECOV_TOKEN }}
uses: codecov/test-results-action@v1
with:
name: ${{ matrix.name }}
files: "*/tests/output/junit/*.xml"
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

- name: Upload coverage data
uses: codecov/codecov-action@v5
with:
name: ${{ matrix.name }}
# verbose: true # optional (default = false)
fail_ci_if_error: true
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }} # cspell:ignore oidc

- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

- name: Delete Merged Artifacts
uses: actions/upload-artifact/merge@v4
with:
include-hidden-files: true
delete-merged: true
pattern: logs-*.zip
sudo apt remove -y docker-compose
sudo apt-get update -y
sudo apt-get --assume-yes --no-install-recommends install -y apt-transport-https curl libkrb5-dev
sudo rm -rf /var/lib/apt/lists/*
python -m pip install --upgrade pip setuptools wheel
python -m pip install tox tox-gh-actions
- name: Test with tox
# run only the env that matches the runner Python (e.g. 3.10 -> py310)
run: tox -e ${{ matrix.tox-env }}
3 changes: 2 additions & 1 deletion tests/resources/test_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from contextlib import contextmanager

from jira.resources import Board
from tests.conftest import JiraTestCase, rndstr
from tests.conftest import JiraTestCase, allow_on_cloud, rndstr


class BoardTests(JiraTestCase):
Expand Down Expand Up @@ -41,6 +41,7 @@ def _create_board(self) -> Iterator[Board]:
if board is not None:
board.delete()

@allow_on_cloud
def test_create_and_delete(self):
# GIVEN: The filter
# WHEN: we create a board
Expand Down
11 changes: 10 additions & 1 deletion tests/resources/test_comment.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from tests.conftest import JiraTestCase
from tests.conftest import JiraTestCase, allow_on_cloud


class CommentTests(JiraTestCase):
Expand All @@ -15,6 +15,7 @@ def tearDown(self) -> None:
for comment in self.jira.comments(issue):
comment.delete()

@allow_on_cloud
def test_comments(self):
for issue in [self.issue_1_key, self.jira.issue(self.issue_2_key)]:
self.jira.issue(issue)
Expand All @@ -28,6 +29,7 @@ def test_comments(self):
comments = self.jira.comments(issue)
assert len(comments) == 0

@allow_on_cloud
def test_comments_start_at(self):
comments_created = []
for i in range(10):
Expand All @@ -42,6 +44,7 @@ def test_comments_start_at(self):
comments = self.jira.comments(self.issue_1_key)
assert len(comments) == 0

@allow_on_cloud
def test_comments_max_results(self):
comments_created = []
for i in range(10):
Expand All @@ -56,6 +59,7 @@ def test_comments_max_results(self):
comments = self.jira.comments(self.issue_1_key)
assert len(comments) == 0

@allow_on_cloud
def test_comments_order_by(self):
comments_created = []
for i in range(10):
Expand All @@ -73,6 +77,7 @@ def test_comments_order_by(self):
comments = self.jira.comments(self.issue_1_key)
assert len(comments) == 0

@allow_on_cloud
def test_expanded_comments(self):
comment1 = self.jira.add_comment(self.issue_1_key, "First comment")
comment2 = self.jira.add_comment(self.issue_1_key, "Second comment")
Expand All @@ -89,6 +94,7 @@ def test_expanded_comments(self):
comments = self.jira.comments(self.issue_1_key)
assert len(comments) == 0

@allow_on_cloud
def test_add_comment(self):
comment = self.jira.add_comment(
self.issue_3_key,
Expand All @@ -100,6 +106,7 @@ def test_add_comment(self):
self.assertEqual(comment.visibility.value, "Administrators")
comment.delete()

@allow_on_cloud
def test_add_comment_with_issue_obj(self):
issue = self.jira.issue(self.issue_3_key)
comment = self.jira.add_comment(
Expand All @@ -112,6 +119,7 @@ def test_add_comment_with_issue_obj(self):
self.assertEqual(comment.visibility.value, "Administrators")
comment.delete()

@allow_on_cloud
def test_update_comment(self):
comment = self.jira.add_comment(self.issue_3_key, "updating soon!")
comment.update(body="updated!")
Expand All @@ -120,6 +128,7 @@ def test_update_comment(self):
# self.assertEqual(comment.visibility.value, 'Administrators')
comment.delete()

@allow_on_cloud
def test_update_comment_with_notify(self):
comment = self.jira.add_comment(self.issue_3_key, "updating soon!")
comment.update(body="updated! without notification", notify=False)
Expand Down
Loading
Loading