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

Integrate unittest in jenkins #13

Open
noppelmax opened this issue Apr 25, 2021 · 2 comments
Open

Integrate unittest in jenkins #13

noppelmax opened this issue Apr 25, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@noppelmax
Copy link
Contributor

Der current development branch produces xunit style results.

Run the following commands

python -m venv .venv
source .venv/bin/activate
pip install --no-cache-dir -r requirements.txt
python -m xmlrunner test/testAllXUnit.py -o testreports

in PROJECT_HOME to get the results in testreports.

The lines above create a new virtual environment under .venv, active it, install the dependencies and run the unittests.

@noppelmax noppelmax added the enhancement New feature or request label Apr 25, 2021
@noppelmax
Copy link
Contributor Author

The file Dockerfile_test can be used to generate a docker container that runs the tests and outputs a results.xml. I have no idea of how we can get the file from the container. docker cp ... did not work for me locally.

@djesionek
Copy link
Member

A dockerfile is not supposed to execute containers it is for building images that, in this case, are supposed to contain dependencies needed for later execution of an application in the container. Your Dockerfile runs the test in what is the build phase of the image which is not the correct way of doing this as it should just install python-opencv in that case.

You would later use the generated image to start up a container that will then run the tests. A container can then have the repo mounted as volume (e.g. using -v argument to the docker run command) to use it as the workspace for executing the tests.
Resulting artifacts stored in this workspace will be available in the mounted workspace and thus also outside of the container.

For Jenkins it's not really necessary to have an additional script also executing tests in the container as in our case it could take care of that inside a given container but it's not bad to have something for local testing or reference.

Does that help?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants