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

Functional testing #42

Merged
merged 20 commits into from
Feb 9, 2017
Merged

Functional testing #42

merged 20 commits into from
Feb 9, 2017

Conversation

tgross
Copy link
Contributor

@tgross tgross commented Feb 3, 2017

This PR will carry #37 and move the example backend into a functional testing rig.

cc @misterbisson @jasonpincin

@tgross tgross changed the title [WIP Functional testing Functional testing Feb 6, 2017
@tgross
Copy link
Contributor Author

tgross commented Feb 6, 2017

I've got an initial test rig done here. I want to get this running on Jenkins next and extend the test to have backends fail before merging this issue.

----------------------------------------------------------------------
NginxStackTest.test_scaleup
----------------------------------------------------------------------
elapsed  | task
22.99161 | docker-compose -f triton/docker-compose.yml -p nginx stop
29.78775 | docker-compose -f triton/docker-compose.yml -p nginx rm -f
106.3892 | docker-compose -f triton/docker-compose.yml -p nginx up -d
8.114008 | docker-compose -f triton/docker-compose.yml -p nginx ps
9.007755 | docker-compose -f triton/docker-compose.yml -p nginx ps
1.740094 | docker inspect nginx_consul_1
80.57586 | docker-compose -f triton/docker-compose.yml -p nginx scale backend=2
.
----------------------------------------------------------------------
Ran 1 test in 352.328s

OK

@tgross
Copy link
Contributor Author

tgross commented Feb 7, 2017

I've extended the tests but they're not stable right now. I'm getting erratic failures which all look to be timeout vs provisioning time and CNS latency issues.

----------------------------------------------------------------------
NginxStackTest.test_scaleup_and_down
----------------------------------------------------------------------
elapsed  | task
29.00812 | docker-compose -f triton/docker-compose.yml -p nginx stop
34.15193 | docker-compose -f triton/docker-compose.yml -p nginx rm -f
131.2256 | docker-compose -f triton/docker-compose.yml -p nginx up -d
13.61234 | docker-compose -f triton/docker-compose.yml -p nginx ps
17.34639 | docker-compose -f triton/docker-compose.yml -p nginx ps
4.732752 | docker inspect nginx_consul_1
41.79441 | docker-compose -f triton/docker-compose.yml -p nginx scale backend=2
8.058235 | wait_for_service: backend
2.693277 | docker exec nginx_backend_2 ifconfig eth0 down
10.08746 | wait_for_service: backend
1.987724 | docker exec nginx_backend_2 ifconfig eth0 up
27.20067 | wait_for_service: backend
.
----------------------------------------------------------------------
Ran 1 test in 503.974s

@tgross
Copy link
Contributor Author

tgross commented Feb 8, 2017

Ok, I think this is ready:

----------------------------------------------------------------------
NginxStackTest.test_scaleup_and_down
----------------------------------------------------------------------
elapsed  | task
19.42238 | docker-compose -f triton/docker-compose.yml -p nginx stop
36.57432 | docker-compose -f triton/docker-compose.yml -p nginx rm -f
55.77278 | docker-compose -f triton/docker-compose.yml -p nginx up -d
9.338359 | docker-compose -f triton/docker-compose.yml -p nginx ps
8.356574 | docker-compose -f triton/docker-compose.yml -p nginx ps
8.356976 | wait_for_containers: {'backend': 1, 'nginx': 1, 'consul': 1}
1.665717 | docker inspect nginx_consul_1
48.00144 | wait_for_service: backend
19.12659 | wait_for_service: containerpilot
5.037040 | wait_for_service: nginx
0.012039 | wait_for_service: nginx-public
0.111934 | wait_for_cns: 
48.77281 | docker-compose -f triton/docker-compose.yml -p nginx scale backend=2
10.49117 | docker-compose -f triton/docker-compose.yml -p nginx ps
10.49165 | wait_for_containers: {'backend': 2, 'nginx': 1, 'consul': 1}
0.003922 | wait_for_service: backend
5.210268 | docker exec nginx_backend_2 ifconfig eth0 down
9.067071 | wait_for_service: backend
1.886657 | docker exec nginx_backend_2 ifconfig eth0 up
2.014246 | wait_for_service: backend
.
----------------------------------------------------------------------
Ran 1 test in 341.341s

OK
Finished: SUCCESS

@jasonpincin
Copy link
Contributor

Looks great to me. First time taking a good look at https://github.com/autopilotpattern/testing. Good stuff! Those tests are nice and easy to understand. Also, having the example app tucked away in the examples folder is so much cleaner IMHO. Less confusing trying to understand the repo now.

@tgross tgross merged commit d9c9fc2 into master Feb 9, 2017
@misterbisson misterbisson deleted the testing branch May 18, 2017 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants