CI/CD Pipelines to Run Unit Testing in Docker [Video]
This video demonstrates how to run unit tests within a Docker container and explains some of the intricacies of a Dockerfile.
Join the DZone community and get the full member experience.Join For Free
This video will focus on how to run unit testing inside a Docker container, and it will show how to run a unit test manually inside the container.
It takes a look at how to run unit tests as part of the CI/CD pipelines. It will explain in detail how Dockerfile builds Docker image to run unit tests and how to save test results as part of the Docker image and how to run a container from that image to see the test results.
For more information about how to work with Docker see Docker for beginners. It will explain the Dockerfile line by line, so you can understand and see exactly what the real operation is and what is happening by each line in the Dockerfile. This is a good opportunity to understand Dockerfile. It starts by copying the project from a local machine which includes the unit test to the remote host machine, running a container, and copying the project from the host machine to the running container then run unit tests and see the results.
After that, creating Dockerfile with all the instructions including pulling a Docker image from a public docker hub, copying the project to the container and running the unit test. The third and the last part is to use Azure Pipelines to do all the Dockerfile steps as part of Continuous Integration pipeline and see Azure Pipelines active log with the unit test execution and test results.
Published at DZone with permission of Mohamed Radwan, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.