podman-compose icon indicating copy to clipboard operation
podman-compose copied to clipboard

Unify tests and run by CI

Open husio opened this issue 3 years ago • 3 comments

I have noticed that the project does not contain any automated tests. tests/ directory contains tests cases made of a docker-compose.yaml and description of how to run the test manually and what is the expected output.

It would be awesome to have an automated test suite, that can be executed by the CI on each change. I think what currently is described in README.md of each test case, can be scripted in python.

Example

The current tests/deps directory description:

podman-compose run --rm sleep /bin/sh -c 'wget -O - http://localhost:8000/hosts'

could be replaced with something similar to this code:

def test_deps():
    with podman_compose_run("--rm", "sleep", "/bin/sh", "-c", "wget  -O - http://localhost:8000/hosts"):
        # web service should be started by the sleep service.
        requests.get('http://localhost:8000')

husio avatar Feb 23 '22 13:02 husio

why is this closed?

this is a very valid point. I'll reopen it

muayyad-alsadi avatar Feb 25 '22 11:02 muayyad-alsadi

Would it make sense if I have created a proposal/example test to show how it could work? I would create a pull request with python code for this.

husio avatar Feb 26 '22 10:02 husio

I've activated pytests on pytests/*.py Those are intended to be unit tests of python methods (no actual creation of containers)

I want to add more tests that involves actually launching containers For that I want github-hosted actions which seems limited to ubuntu (I prefer fedora) I want to a way to install modern podman 3.4 or more on github hosted work flows

muayyad-alsadi avatar Feb 26 '22 12:02 muayyad-alsadi

I've started getting GitLab CI running over here: https://gitlab.com/mikeklem/python-podman-compose/

MikeKlem avatar Mar 07 '24 15:03 MikeKlem

I think this is no longer relevant as we have a number of test cases in tests/ subdirectory. These are run as part of Github CI.

I will close this issue, but please reopen it if you think my reasoning is invalid.

p12tic avatar Mar 08 '24 18:03 p12tic