Skip to content

Commit 1e36e37

Browse files
committed
Simplify workflow tests
1 parent 7cd0962 commit 1e36e37

File tree

4 files changed

+12
-102
lines changed

4 files changed

+12
-102
lines changed

.github/workflows/tests.yml

Lines changed: 5 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -3,97 +3,24 @@ name: Run parallel tests
33
on: [push, pull_request]
44

55
jobs:
6-
docker-tests:
7-
name: Docker Tests / Python ${{ matrix.python-version }}
6+
test:
7+
name: Tests / Python ${{ matrix.python-version }}
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
1111
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
1212

1313
steps:
1414
- uses: actions/checkout@v3
15-
1615
- name: Set up Python
1716
uses: actions/setup-python@v3
1817
with:
1918
python-version: ${{ matrix.python-version }}
20-
19+
- uses: gacts/install-podman@v1
2120
- name: Install dependencies
2221
run: |
2322
python -m pip install --upgrade pip
2423
pip install hatch
25-
26-
- name: Install Docker CE
27-
run: |
28-
sudo apt-get update
29-
sudo apt-get install -y \
30-
ca-certificates \
31-
curl \
32-
gnupg \
33-
lsb-release
34-
sudo mkdir -p /etc/apt/keyrings
35-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
36-
echo \
37-
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
38-
$(lsb_release -cs) stable" | \
39-
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
40-
sudo apt-get update
41-
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
42-
sudo systemctl start docker
43-
docker --version
44-
45-
- name: Run Docker scenario tests
46-
run: |
47-
hatch run ci -- dbtesttools.tests.test_pgfixture_docker dbtesttools.tests.test_isolation
48-
49-
podman-tests:
50-
name: Podman Tests / Python ${{ matrix.python-version }}
51-
runs-on: ubuntu-latest
52-
strategy:
53-
matrix:
54-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
55-
56-
steps:
57-
- uses: actions/checkout@v3
58-
59-
- name: Set up Python
60-
uses: actions/setup-python@v3
61-
with:
62-
python-version: ${{ matrix.python-version }}
63-
64-
- name: Install dependencies
65-
run: |
66-
python -m pip install --upgrade pip
67-
pip install hatch
68-
69-
- name: Install Podman
70-
run: |
71-
sudo apt-get update
72-
sudo apt-get install -y podman
73-
podman --version
74-
75-
- name: Start Podman API (rootless)
76-
run: |
77-
export XDG_RUNTIME_DIR="/run/user/$(id -u)"
78-
sudo mkdir -p "$XDG_RUNTIME_DIR"
79-
sudo chown $(id -u):$(id -g) "$XDG_RUNTIME_DIR"
80-
mkdir -p "$XDG_RUNTIME_DIR"
81-
nohup podman system service --time=0 unix://$XDG_RUNTIME_DIR/podman/podman.sock > podman-api.log 2>&1 &
82-
echo "Waiting for podman.sock..."
83-
for i in {1..10}; do
84-
if podman info > /dev/null 2>&1; then
85-
echo "Podman is up"
86-
break
87-
fi
88-
sleep 2
89-
done
90-
cat podman-api.log
91-
if ! podman info > /dev/null 2>&1; then
92-
echo "::error ::Podman API service failed to start"
93-
cat podman-api.log
94-
exit 1
95-
fi
96-
97-
- name: Run Podman scenario tests
24+
- name: Run tests
9825
run: |
99-
hatch run ci -- dbtesttools.tests.test_pgfixture_podman dbtesttools.tests.test_isolation
26+
hatch run ci

README.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,13 @@ PG containers. You will need to do up to two extra things:
9494

9595
If you want to use Podman instead of Docker engine you will need to follow
9696
these steps:
97-
1. Enable and start podman on your host
98-
```bash
99-
systemctl --user enable podman
100-
systemctl --user start podman
101-
```
102-
2. `export DBTESTTOOLS_USE_PODMAN=1` variable.
97+
98+
1. Enable and start podman on your host
99+
```bash
100+
systemctl --user enable podman
101+
systemctl --user start podman
102+
```
103+
2. `export DBTESTTOOLS_USE_PODMAN=1` variable.
103104

104105
This code has been in use daily on a large project at Cisco for a few years
105106
now, and is very stable.

dbtesttools/tests/test_pgfixture_docker.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

dbtesttools/tests/test_pgfixture_podman.py

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)