This project is intended to enable development of a CI pipeline to design and test parallel CI tests using Docker (or other agents) and aggregating the results in a Jenkins pipeline. The idea is to provide a framework for splitting massive tests into smaller test agents to speed up feedback timings.
This repository contains the material to accompany the blog post Parallelized Jenkins Jobs using Docker.
Install easy_install, pip and virtualenv. Then, clone this repository and navigate to this example:
$ git clone https://<git_location>/python-parallel-ci-tests.git
$ cd scriptbox/python-parallel-ci-tests
Install the required environment and libraries:
$ virtualenv --no-site-packages --distribute .env
$ source .env/bin/activate
$ pip install -r requirements.txt
You can test the application locally by running the PyTest Unit test suite (which is what a CI pipeline in Jenkins or some other CI tool would use):
$ python -m pytest tests/
To start the Flask application, simply run the run.py
script:
$ python run.py
You can now open a browser and navigate to http://<SERVER_IP>:8000/?job_id=5
to see the Hello World Flask
basic website which shows the "job_id" passed in the URL.
There is a Dockerfile within the repository which bakes the Python tools required for this repository to work with a Jenkins Docker slave image. You can build the Docker image like so:
$ docker build -t jenkins/ssh-slave-modified .
Once the build completes, run the command docker image ls
and you should see your new image in place.
All content within created by the author are licensed under the LICENSE.txt contents unless specified otherwise.