BuildWise CT Server in Docker
Set up a BuildWise Continuous Testing server in a Docker container.
BuildWise is a free and open-source Continuous Testing server. I have used it in the past for uni and intern work. Running BuildWise in a Docker container may be helpful as you can skip all the manual set-up steps yourself. This article shows how to start up a BuildWise CT server in a Docker container.
Dockerfile Design Steps
Use Docker’s base image: ruby
It comes with Debian Linux and Ruby pre-installed.Download and unzip BuildWise to a specific folder
In this case, I unzipped BuildWise to/var/www/sinatra
.Install the gems (libraries) required by the BuildWise server
Runbundle install
.Start the BuildWise server
I am running the server on container port 80.For demo purposes, I’ve cloned a test project from Github
Cloned the project to~/work/projects/buildwise-samples
Start the BuildWise server when the container starts
Build & Run the container
docker build -f Dockerfile . -t "buildwise";
docker run -it -d -p 80:80 --name buildwise buildwise
It will take about one minute to build, then the BuildWise server will be up and running on http://localhost
.
BuildWise Server running in docker
For the use of BuildWise, check out its documentation or the book: Practical Continuous Testing.
After logging in (default credentials: admin
/buildwise
), I create a new demo project.
After the build project is created, click the “Build Now” button to trigger a run of the automated API tests. Here is a build report for the sample API project.
Complete Dockerfile
FROM rubyEXPOSE 80/tcpRUN apt-get update -qq \
&& apt-get install -y build-essential \
&& mkdir -p /var/www/sinatra \
&& curl http://agileway.com.au/sites/testwisely/downloads/buildwise/buildwise-2.1.1.zip --output /var/www/sinatra/buildwise-2.1.1.zip \
&& cd /var/www/sinatra \
&& unzip /var/www/sinatra/buildwise-2.1.1.zip \
&& mkdir -p /var/www/sinatra/shared \
&& echo "abcde12345" > /var/www/sinatra/shared/server.digest \
&& cd /var/www/sinatra \
&& ln -s buildwise-2.1.1 buildwise \
&& cd /var/www/sinatra/buildwise \
&& bundle install \
&& sed -i 's/3618/80/' startup-demo.sh \
&& mkdir -p ~/work/projects \
&& git clone https://github.com/testwisely/buildwise-samples.git ~/work/projects/buildwise-samplesWORKDIR /var/www/sinatra/buildwise
CMD ./startup-demo.sh
Final Considerations
The sample test I used above was an API test. If you want to run functional end-to-end UI tests, then you need to install Chrome and its matching Chromedriver.
Zhimin’s Notes:
As the creator of BuildWise, I don’t suggest running the BuildWise server in Docker or Kubernetes, for the reasons below:
BuildWise Server is very easy to set up anyway.
As you have seen in Courtney’s Dockerfile, only a few steps.With Automated End-to-End Test execution for web apps, ChromeDriver needs to be updated now and then.
Chrome self-updates about every 2 months, the ChromeDriver must be updated ~4 months. This means updates to Dockerfile might be required.
For this change, I find it easy to do in a native OS, such as macOS.There is little scalability issue with BuildWise
Besides set-up convenience (for first-timers), there is no benefit I can see with a container-based approach for BuildWise.A BuildWise CT server, in a real Agile/DevOps team, is the heart of SDLC.
This means it is better on its dedicated machine, always up-running and executing tests as quickly as possible. A native machine (macOS or Linux, Windows is slow) is better.If someone wants the completely worry-free setup of BuildWise, try TestWisely, a cloud-based continuous testing platform.
Just sign up for an account (with a free trial, no credit cards required) to use it.
By the way, this Docker file runs a BuildWise server with a sqlite3 database. For production use, I recommend using MySQL or MariaDB instead.