This document serves as a place to document manual testing setups for ensuring proper functionality of the Jenkins plugin.
In order to test the proxy server functionality, from Jenkins, we need a development setup.
Utilized the following docker containers:
Pull down the sameersbn/squid
docker image, and run while exposing port 3128.
docker pull sameersbn/squid:3.3.8-4
docker build -t sameersbn/squid github.com/sameersbn/docker-squid
docker run --name squid -d --restart=always \
--publish 3128:3128 \
--volume /srv/docker/squid/cache:/var/spool/squid3 \
sameersbn/squid:3.3.8-4
Run a Jenkins docker image, exposing ports 8080 and 50000:
docker run -d --name web -p 8080:8080 -p 50000:50000 jenkins
From here, you'll connect to Jenkins UI from your browser, through localhost:8080
. Once you are connected, follow these steps:
- Install the Datadog Plugin, either via the Update Center, or via .hpi
- Configure with an API key
- Create a test build
Now, we need to connect to the squid docker container to do some introspection, so we can prove that the proxy is routing this data.
docker exec -it squid bash
Once you are conencted to the squid box, run a tcp dump to follow port 3128.
apt-get update
apt-get install -y tcpdump
sudo tcpdump -i eth0 -vvvvtttAXns 1500 'port 3128'
Now that this window is following all the traffic coming through port 3128, let's go back to the Jenkins UI.
- Run the test build that you had setup previously.
- Look on the output from the tcpdump. You should NOT see any output.
- Now go to
Manage Jenkins
>Manage Plugins
, and then select theAdvanced
tab. - From here you will see the 'HTTP Proxy Configuration' section. Enter the following information:
- Server: 172.17.42.1
- Port: 3128
- Optionally, you can click
Advanced
, and then testhttp://www.google.com
and you should see the output in the tcpdump terminal window. - Finally, run the test build again.
- You should now see output from the tcpdump terminal window!
Repeat this by enabling/disabling the proxy configuration in Jenkins and repeating the test to prove to yourself that it was not a fluke. Note: I've noticed that Jenkins seems to send a disconnection series of packets to the proxy server with the first connection attempt (when you run your test build), after you've disabled the proxy configration. Run the test job a second time, and you'll again not see any output.
In order to check that the Java style meets the recommendations of Sun and Google, as closely as possible, here is a way to test it.
- Download the most recent checkstyle jar from SourceForge.
- Grab the style checks from Sun and Google.
- Note: We following 100 character line length, so remove the
<module name="LineLength"/>
line from sun_check.xml.
-
Run each check, one at a time:
java -jar checkstyle-6.13-all.jar -c /sun_checks.xml MyClass.java java -jar checkstyle-6.13-all.jar -c /google_checks.xml MyClass.java
More detailed instructions on using checkstyle can be found here.