Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace docker-compose with podman-compose #222

Closed
wants to merge 1 commit into from
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- cron: '0 */8 * * *'
jobs:
integration:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Install package dependencies
run: |
sudo apt-get update
sudo apt-get --assume-yes --no-install-recommends install libsystemd0 libsystemd-dev pkg-config
sudo apt-get --assume-yes --no-install-recommends install libsystemd0 libsystemd-dev pkg-config podman-compose

- name: Install test requirements
run: |
Expand Down
7 changes: 1 addition & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ We recommend setting up a Python virtual environment to install the test depende

### Integration tests

Integration tests require the addition of [docker](https://docs.docker.com/engine/install/) or [podman](https://podman.io/getting-started/installation) and [docker-compose](https://docs.docker.com/compose/install/).
We recommend installing the Python implementation of `docker-compose` via pip:

```
pip install docker-compose
```
Integration tests require the addition of [docker](https://docs.docker.com/engine/install/) or [podman](https://podman.io/getting-started/installation).

Then install the collection directly from your local repo and execute the tests:

Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ aiohttp
aiokafka
azure-servicebus
dpath
kafka-python
# kafka-python
kafka-python-ng
psycopg
pyyaml
systemd-python; sys_platform != 'darwin'
Expand Down
1 change: 1 addition & 0 deletions test_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ asyncmock
pytest-asyncio
pytest-timeout
ansible
podman-compose
requests
ansible-rulebook
tox
5 changes: 3 additions & 2 deletions tests/integration/event_source_kafka/test_kafka_source.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import json
import os
import subprocess
import sys

import pytest
from kafka import KafkaProducer
Expand All @@ -21,9 +22,9 @@ def kafka_certs():
def kafka_broker():
cwd = os.path.join(TESTS_PATH, "event_source_kafka")
print(cwd)
result = subprocess.run(["docker-compose", "up", "-d"], cwd=cwd, check=True)
result = subprocess.run([sys.executable, "-m", "podman_compose", "up", "-d"], cwd=cwd, check=True)
yield result
subprocess.run(["docker-compose", "down", "-v"], cwd=cwd, check=True)
subprocess.run([sys.executable, "-m", "podman_compose", "down", "-v"], cwd=cwd, check=True)


@pytest.fixture(scope="session")
Expand Down
9 changes: 8 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ requires =
pylint

[testenv]
basepython = python3.9, python3.10
basepython = python3.9, python3.10, python3.11, python3.12
[testenv:lint]
deps = pre-commit
desc = Run linters
commands = pre-commit run -a

[testenv:integration]
description = Run integration tests
deps = -r{toxinidir}/test_requirements.txt
commands =
ansible-galaxy collection install .
pytest tests/integration -vvv -s

[testenv:ruff]
deps = -r{toxinidir}/lint_requirements.txt
commands = ruff check --select ALL --ignore INP001,RUF100,FA102,PLR0913 -q extensions/eda/plugins
Expand Down
Loading