Skip to content
This repository was archived by the owner on Mar 28, 2019. It is now read-only.

Conversation

@danieldreier
Copy link
Contributor

The first iteration of acceptance tests lumped all tests into one big run on a single VM, which caused problems because the cleanup tasks were imperfect. For example, a failed cleanup could leave a process listening on port 8140, which caused the subsequent test to fail incorrectly.

This moves the tests into separate files and tags them, so that rspec tags can be used to run an more limited set of tests (e.g. just unicorn, just passenger, just the agent tests, etc). I've also removed the cleanup tasks because they are no longer necessary and I don't think we should support both approaches to testing.

The advantage here is no chance of bleed-over between test cases, whereas the previous way required imperfect automated cleanup between test cases. There are two major downsides: first, comprehensive testing of all cases requires considerably longer because a new VM must be provisioned for each case. Running all tests will take ~1.5 hours instead of ~20 minutes. Second, tests can no longer be run via a convenient rake task. The new syntax has been documented in CONTRIBUTING.md but it's less obvious.

I believe the tradeoff is acceptance because this is a step toward running reliable, trustable integration tests via jenkins (or similar). In that case, the tests can be parallelized by test case and OS. Given sufficient parallelization, this approach will run faster than the more linear approach, because each individual test is faster.

A minor side change is the the default test environment switches from Ubuntu 12.04 to Debian Wheezy, because Debian is the only fully supported target environment at this point. (And, I don't think anybody but me runs the tests anyway, and I always run them against Debian anyway)

I've also modestly improved the quality of the tests by adding an agent run to each server test, and doing sanity checks to confirm that the other services aren't running (e.g. nginx shouldn't be running in the webrick test case).

Daniel Dreier added 3 commits November 20, 2014 18:32
Ubuntu is still available but the default is Debian 7
passenger, thin, unicorn, and webrick can be tested independently
This implies differences to how tests are run, so documentation was
updated
The advantage here is no chance of bleed-over between test cases,
whereas the previous way required imperfect automated cleanup between
test cases.
This also permits testing one thing at a time to save a little bit of
time. Unfortunately, it also means that testing all cases requires
considerably longer because a new VM must be provisioned for each case.
Add an actual agent run to each test, to confirm that the master is able
to serve requests in some basic capacity. Would have caught the "unicorn
/ nginx support broken" issue where ssl headers weren't passed right.

Also moves some of the tests into common blocks to reduce duplication.
zachfi added a commit that referenced this pull request Nov 22, 2014
@zachfi zachfi merged commit 67532f8 into puppetlabs-operations:master Nov 22, 2014
@danieldreier danieldreier deleted the refactor_tests branch November 22, 2014 00:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants