diff --git a/README.md b/README.md index 418b8e3..13b8bbb 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,41 @@ This repo contains script to automate and test deployments on [Red Hat Managed Services](https://www.openshift.com/learn/topics/managed-services) +## Available Environments -# Available Environments +- [Red Hat OpenShift Service on AWS (ROSA)](https://www.openshift.com/products/amazon-openshift) -## [Red Hat OpenShift Service on AWS (ROSA)](https://www.openshift.com/products/amazon-openshift) - -Managed OCP4 installed on AWS +## Managed OCP4 installed on AWS ### Available Testers + - [osde2e-wrapper](./osde2e/README.md) - [rosa-wrapper](./rosa/README.md) + +## Running tests + +### Local testing + +To run tests locally use the folling command: + +`tox .` + +If you have a dirty virtual environment use the option `-r` in `tox` to recreate the environments. + +### Testing in a container + +The container must have internet access to build, it is not necessary to install any requirenments in your workstation. + +First build the image that will run the tests: + +`podman build -f tests/Dockerfile --tag tox-test:latest .` + +The tag can be anything you want and can be changed, in thsi case we are using `tox-test:latest`. + +To run the tests execute: + +`podman run --rm -ti tox-test:latest` + +You can execute any sub-environment of `tox` by doing the following: + +`podman run --rm -ti tox-test:latest tox -e stage` diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 815fd5f..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -flake8 -elasticsearch diff --git a/tests/Dockerfile b/tests/Dockerfile new file mode 100644 index 0000000..8914865 --- /dev/null +++ b/tests/Dockerfile @@ -0,0 +1,6 @@ +FROM quay.io/redhat-aqe/tox:latest +RUN useradd -m -U fedora +USER fedora +COPY --chown=fedora:fedora ../. /home/fedora +WORKDIR /home/fedora +CMD ["tox", "."] diff --git a/tests/test-requirements.txt b/tests/test-requirements.txt new file mode 100644 index 0000000..5ac0cb0 --- /dev/null +++ b/tests/test-requirements.txt @@ -0,0 +1,2 @@ +flake8 +elasticsearch \ No newline at end of file diff --git a/tox.ini b/tox.ini index 213d73a..9abf5cc 100644 --- a/tox.ini +++ b/tox.ini @@ -4,7 +4,7 @@ skipsdist=True [testenv] setenv = VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/test-requirements.txt +deps = -r{toxinidir}/tests/test-requirements.txt basepython = python commands = flake8 {posargs} @@ -21,4 +21,4 @@ show-source = True ignore = E123,E125,E226,E302,E41,E231,E203,E501,E741,H233,H306,H238,H236,H404,H405,W504 max-line-length = 110 builtins = _ -exclude=.venv,.git,.tox,*lib/python*, +exclude=.venv,.git,.tox,*lib/python*,.local