Feature #11743

Run each test in an isolated, clean environment

Added by Nick Lewis 4 months ago. Updated 3 months ago.

Status:Duplicate Start date:01/04/2012
Priority:Normal Due date:
Assignee:Dominic Maraglia % Done:

0%

Category:Harness
Target version:-
Patch:None Branch:
Keywords:
Votes: 0

Description

Currently the tests are highly coupled and order-dependent in ways which aren’t relevant to the tests themselves. Some tests rely on other tests producing certs for them, others fail if one is present, etc. It would be great to either have a “before”/“after” step to clean the environment (removing confdir, vardir, etc.), or helpers for running puppet which runs it using a dedicated confdir/vardir per test.

This would reduce false positives, false negatives, and general test fragility. Additionally, it would be a valuable first step in standardizing the way tests are shaped, making it easier to find examples to follow, and to make further improvements to the harness itself without worrying if it will negatively affect tests.

History

Updated by Dominic Maraglia 4 months ago

  • Category set to Harness
  • Status changed from Unreviewed to Accepted

Nick,

Please schedule a time when we can work on this together.

Updated by Josh Cooper 4 months ago

The with_master_running_on method will now delete the ssl directory for all hosts and the var directory for all agents. This eliminates inter-test agent/master dependencies with ssl certs, cached catalogs. Obviously not a complete solution that this ticket is requesting, but it has helped for agent/master acceptance tests.

Updated by Justin Stoller 3 months ago

  • Status changed from Accepted to Duplicate

Nick’s right on about this, and I think that his idea of having setup/teardown blocks are the right way to go long term. We’ve got a ticket open about setup/teardown blocks #6162.

I’m closing this as a duplicate of the before/after ticket. Additional work may need to be done to add helpers to run Puppet in certain ways, but as we add those we need to keep in my differences between FOSS and PE. There’s also a ticket for that.

Also available in: Atom PDF