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
15 changes: 10 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Check code style
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
- name: Install precommit
run: pip install pre-commit
- name: Check lint
Expand All @@ -26,8 +26,10 @@ jobs:
include:
- os: ubuntu-24.04
python: "3.12"
- os: ubuntu-26.04
python: "3.14"
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v7
- name: Install packages
run: sudo apt-get update && sudo apt-get install podman golang-github-containernetworking-plugin-dnsname sqlite3 jq
- name: Install uv
Expand All @@ -53,9 +55,12 @@ jobs:
run: podman exec testnode_0 journalctl
- name: Wait
run: uv run ceph-devstack wait teuthology
- name: Dump logs
- name: Dump dispatcher log
if: success() || failure()
run: podman logs -f teuthology
- name: Dump job log
if: success() || failure()
run: uv run ceph-devstack logs
- name: Create archive
if: success() || failure()
run: |
Expand All @@ -67,7 +72,7 @@ jobs:
sqlite3 /tmp/dev.db ".output stdout" ".mode json" "select * from jobs" | jq | tee /tmp/artifacts/jobs.json
- name: Upload jobs.json
if: success() || failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7.0.1
with:
name: jobs
path: /tmp/artifacts/jobs.json
Expand All @@ -77,7 +82,7 @@ jobs:
tar -czf /tmp/artifacts/archive.tar ~/.local/share/ceph-devstack/archive/
- name: Upload log archive
if: success() || failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7.0.1
with:
name: archive
path: /tmp/artifacts/archive.tar
Expand Down
18 changes: 7 additions & 11 deletions .github/workflows/tox.yml → .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: tox
name: pytest

on:
pull_request:
Expand All @@ -8,26 +8,22 @@ on:

jobs:
test:
name: tox on python${{ matrix.python }} via ${{ matrix.os }}
name: pytest on python${{ matrix.python }} via ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-22.04
python: "3.10"
- os: ubuntu-22.04
python: "3.11"
- os: ubuntu-24.04
python: "3.12"
- os: ubuntu-24.04
python: "3.13"
- os: ubuntu-26.04
python: "3.14"
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6.3.0
with:
python-version: ${{ matrix.python }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Run unit tests
run: uv run --extra test tox
run: uv run --all-extras pytest
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
- name: Install Python 3.13
Expand Down
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ classifiers = [
]
keywords = ["podman", "ceph"]
description = "Run a full teuthology lab on your laptop!"
requires-python = ">=3.10"
requires-python = ">=3.12"
dependencies = ["packaging", "pre-commit", "PyYAML", "tomlkit"]
dynamic = ["version"]

Expand Down Expand Up @@ -45,3 +45,8 @@ requires = [
"wheel",
"setuptools-scm>=8",
]

[tool.pytest.ini_options]
testpaths = ["tests"]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

14 changes: 14 additions & 0 deletions tests/resources/ceph/test_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@

class _TestContainerEnvVars:
@pytest.fixture(scope="class")
@classmethod
def cls(self):
raise NotImplementedError

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
# return {}
raise NotImplementedError
Expand All @@ -28,10 +30,12 @@ def test_env_vars(self, cls, env_vars):

class TestPostgres(_TestContainerEnvVars):
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return containers.Postgres

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
return {
"POSTGRES_USER": "root",
Expand All @@ -44,10 +48,12 @@ def env_vars(self):

class TestPaddles(_TestContainerEnvVars):
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return containers.Paddles

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
return {
"PADDLES_SERVER_HOST": "0.0.0.0",
Expand All @@ -56,10 +62,12 @@ def env_vars(self):

class TestPulpito(_TestContainerEnvVars):
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return containers.Pulpito

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
return {
"PULPITO_PADDLES_ADDRESS": "http://paddles:8080",
Expand All @@ -68,10 +76,12 @@ def env_vars(self):

class TestTestNode(_TestContainerEnvVars):
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return containers.TestNode

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
return {
"CEPH_VOLUME_ALLOW_LOOP_DEVICES": "true",
Expand All @@ -80,10 +90,12 @@ def env_vars(self):

class TestTeuthology(_TestContainerEnvVars):
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return containers.Teuthology

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
return {
"SSH_PRIVKEY": "",
Expand All @@ -102,9 +114,11 @@ def env_vars(self):

class TestBeanstalk(_TestContainerEnvVars):
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return containers.Beanstalk

@pytest.fixture(scope="class")
@classmethod
def env_vars(self):
return {}
1 change: 1 addition & 0 deletions tests/resources/ceph/test_testnode.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

class TestTestnode:
@pytest.fixture(scope="class")
@classmethod
def cls(self) -> type[_TestNode]:
return _TestNode

Expand Down
2 changes: 1 addition & 1 deletion tests/resources/test_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def cls(self):
return Container

@pytest.fixture(
scope="class", params=["build", "create", "start", "stop", "remove"]
scope="function", params=["build", "create", "start", "stop", "remove"]
)
def action(self, request):
return request.param
Expand Down
3 changes: 2 additions & 1 deletion tests/resources/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@

class TestMiscResource(_TestPodmanResource):
@pytest.fixture(scope="class", params=[Network, Secret])
@classmethod
def cls(self, request):
return request.param

@pytest.fixture(scope="class", params=["create", "exists", "remove"])
@pytest.fixture(scope="function", params=["create", "exists", "remove"])
def action(self, request):
return request.param

Expand Down
3 changes: 2 additions & 1 deletion tests/resources/test_podmanresource.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@

class TestPodmanResource:
@pytest.fixture(scope="class")
@classmethod
def cls(self):
return PodmanResource

@pytest.fixture(scope="class", params=["create", "remove"])
@pytest.fixture(scope="function", params=["create", "remove"])
def action(self, request):
return request.param

Expand Down
Loading