Skip to content

Commit 7a75afe

Browse files
committed
Update testing section
Add common issues section Add docs on how to skip tests based on podman's version and os Signed-off-by: Nicola Sella <[email protected]>
1 parent 34409e8 commit 7a75afe

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,41 @@ tox -e py -- --pnext -m pnext podman/tests/integration/test_container_create.py
8484
The option `--pnext` **enables** the tests with the `pnext` pytest marker, and `-m pnext` will run
8585
the marked tests **only**.
8686

87+
#### Testing version-specific or distro-specific scenarios
88+
89+
Tests can be conditionally skipped based on `podman`'s version or on the host
90+
that's running the test suite.
91+
92+
```python
93+
from podman.tests.utils import OS_RELEASE, PODMAN_VERSION
94+
95+
96+
@pytest.mark.skipif(
97+
PODMAN_VERSION < (5, 6, 0),
98+
reason="Feature introduced in Podman 5.6.0 https://github.com/...",
99+
)
100+
@pytest.mark.skipif(
101+
OS_RELEASE["ID"] == "fedora" and int(OS_RELEASE["VERSION_ID"]) < 42,
102+
reason="Feature patched in F42 or later https://github.com/...",
103+
)
104+
```
105+
106+
#### Common test issues
107+
108+
Tests work by establishing a ssh connection with localhost. If you see
109+
this line repeating after launching tox you might need to fix your ssh to be
110+
able to connect locally.
111+
112+
```log
113+
...
114+
2025-09-25 13:20:44 [ DEBUG] Waiting on /run/user/1000/podman/podman-forward-a65fd89525a248608d4c.sock (ssh.py:89)
115+
2025-09-25 13:20:44 [ DEBUG] Waiting on /run/user/1000/podman/podman-forward-a65fd89525a248608d4c.sock (ssh.py:89)
116+
...
117+
```
118+
119+
Most of the times, if you can run `ssh localhost exit` successfully your tests
120+
will run.
121+
87122
## Submitting changes
88123

89124
- Create a github pull request (PR)

0 commit comments

Comments
 (0)