Re: [Puppet-dev] Proposal: add universal assertions on logs to puppet spec tests.

2011-03-03 Thread Luke Kanies
On Mar 3, 2011, at 11:14 PM, Daniel Pittman wrote: > On Thu, Mar 3, 2011 at 21:40, Luke Kanies wrote: >> On Mar 2, 2011, at 5:07 PM, Daniel Pittman wrote: >>> On Wed, Mar 2, 2011 at 16:32, Ben Hughes wrote: On Wed, Mar 02, 2011 at 03:24:32PM -0800, Daniel Pittman wrote: > After ev

Re: [Puppet-dev] Proposal: add universal assertions on logs to puppet spec tests.

2011-03-03 Thread Daniel Pittman
On Thu, Mar 3, 2011 at 21:40, Luke Kanies wrote: > On Mar 2, 2011, at 5:07 PM, Daniel Pittman wrote: >> On Wed, Mar 2, 2011 at 16:32, Ben Hughes wrote: >>> On Wed, Mar 02, 2011 at 03:24:32PM -0800, Daniel Pittman wrote: >>> After every single test in the spec suite, assert that there are no

Re: [Puppet-dev] Stop using 'test/lib/*' for 'spec/*' tests.

2011-03-03 Thread Luke Kanies
Great patch set, Daniel - well done. On Mar 3, 2011, at 4:42 PM, Daniel Pittman wrote: > Ages back we moved from Test::Unit to RSpec based testing as our primary > mechanism; at the time we ported a bunch of tests over that still depended on > the old infrastructure. > > One of the key things th

[Puppet-dev] [PATCH] (#6582) Don't demand the checkout be named 'puppet'.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman As part of implementing the fixture support I hard-coded the assumption that the git checkout was a directory named 'puppet'; this broke on our CI server, and would break for anyone else who didn't follow that default. This commit eliminates that assumption and depends only

Re: [Puppet-dev] [PATCH/puppet 1/1] maint: Fix a randomization test failure

2011-03-03 Thread Daniel Pittman
On Thu, Mar 3, 2011 at 18:39, Matt Robinson wrote: > The commit for #2597 included a test that asserted the text resulting > from detecting a cycle.  However, the cycle detection could start > randomly from any node, resulting in different text in the error.  I'm > not sure what the randomization

Re: [Puppet-dev] Proposal: add universal assertions on logs to puppet spec tests.

2011-03-03 Thread Luke Kanies
On Mar 2, 2011, at 5:07 PM, Daniel Pittman wrote: > On Wed, Mar 2, 2011 at 16:32, Ben Hughes wrote: >> On Wed, Mar 02, 2011 at 03:24:32PM -0800, Daniel Pittman wrote: >> >>> After every single test in the spec suite, assert that there are no >>> log messages at error or higher in the collected l

[Puppet-dev] [PATCH/puppet 1/1] maint: Fix a randomization test failure

2011-03-03 Thread Matt Robinson
The commit for #2597 included a test that asserted the text resulting from detecting a cycle. However, the cycle detection could start randomly from any node, resulting in different text in the error. I'm not sure what the randomization key would be based on since the test failed consistently ove

[Puppet-dev] [PATCH 09/11] (#6582) unstub Puppet settings to improve indirector queue tests.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman This code was stubbing Puppet settings, which is no longer required now we reset them between tests. Using the real thing reduces points that the rest of the code can break, too. As a side effect this caused Puppet[:trace] to be "true", which meant that we emitted a huge, n

[Puppet-dev] [PATCH 10/11] (#6582) eliminate a backtrace from mismatched block arguments.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman This was tightly coupled to the code implementation; it mostly still is, but now allows argument extension without needing to adjust the test which is only focused on the first argument anyhow. Reviewed-By: Nick Lewis --- spec/unit/parser/parser_spec.rb |2 +- 1 file

[Puppet-dev] [PATCH 08/11] (#6582) Eliminate the last vestige of the unit tests from the specs.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman This eliminates a stub module in spec_helper, which was used for compatibility with code that didn't bother to require the right files out of the unit tests. It also removes test/lib from LOAD_PATH when running specs, since we don't run with that code, and now we detect that

[Puppet-dev] [PATCH 07/11] (#6582) eliminate fakeresource use in ssh_authorized_key spec.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman We replace it with an instance of the actual resource we are testing, which reduces the number of ways this code is tied to the specific implementation. Reviewed-By: Nick Lewis --- spec/unit/provider/host/parsed_spec.rb |1 + .../provider/ssh_authorized_key

[Puppet-dev] [PATCH 11/11] (#6582) stub puts to prevent screen output when testing help.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman We only really want to verify that the code exits, but the current implementation emits text directly; this results in messing up the tests, which we can avoid with this tiny shim. Reviewed-By: Nick Lewis --- spec/unit/application_spec.rb |1 + 1 files changed, 1 inser

[Puppet-dev] [PATCH 05/11] (#6582) Eliminate the old fakedata helper method.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman This is replaced with the new my_fixture{,s} methods; old fixture data is ported into the spec tests at the same time, but left where it was against unit tests that require it. Reviewed-By: Nick Lewis --- .../integration/provider/mailalias/aliases/test1 | 28 +

[Puppet-dev] [PATCH 04/11] (#6582) move more helper code into methods, out of RSpec#configure

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman We move the tempfile cleanup support off into the module that uses it, which removes some of the dependency on magic globals from configure. It still exists, but is hidden in the same module that uses it, which helps. Reviewed-By: Nick Lewis --- spec/lib/puppet_spec/files

[Puppet-dev] [PATCH 02/11] (#6582) order RSpec global :before and :after hooks naturally.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman Specifically, reverse the order of the two in spec_helper so that they make more sense; the inverted order was confusing. There are no functional changes, only code movement, in this patchset. Reviewed-By: Nick Lewis --- spec/spec_helper.rb | 34 +---

[Puppet-dev] [PATCH 01/11] (#6407) Fix spec test hang with Mocha >= 0.9.11 in zlib testing

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman We had a combination of bad logic, and bad testing, and a nasty behaviour of Mocha <= 0.9.10 that would result in a false pass for one of our tests. This not only falsely passed, but hid an infinite loop retrying decompression on an invalid data stream; it could be triggered

[Puppet-dev] [PATCH 06/11] (#6582) eliminate fakeparsefile helper method.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman This was a helper that implemented rspec style "shared behaviour" for Test::Unit; now that we have moved on we can use the upstream implementation instead. This eliminates a whole bit of code we have to maintain. Reviewed-By: Nick Lewis --- .../integration/provider/mailal

[Puppet-dev] [PATCH 03/11] (#6582) add fixture helper methods to replace unit test code.

2011-03-03 Thread Daniel Pittman
From: Daniel Pittman We validate that fixtures exist, when requested, or that they match something when they use a glob. This catches internal errors where we don't match any fixtures with a glob; this can reveal problems that would otherwise avoid all assertions and result in internal failures.

[Puppet-dev] Stop using 'test/lib/*' for 'spec/*' tests.

2011-03-03 Thread Daniel Pittman
Ages back we moved from Test::Unit to RSpec based testing as our primary mechanism; at the time we ported a bunch of tests over that still depended on the old infrastructure. One of the key things this introduces is global "fixture" helpers, especially "my_fixture" and "my_fixtures", which magical

[Puppet-dev] [PATCH/puppet 1/1] (#6445) Fix inline docs: puppet agent does not accept --mkusers

2011-03-03 Thread nfagerlund
From: Ben Hughes Inline documentation in lib/puppet/reference/configuration.rb stated that puppet agent accepted the --mkusers flag, which is only intended for use with puppet master. Signed-off-by: nfagerlund --- lib/puppet/reference/configuration.rb |2 +- 1 files changed, 1 insertions(

[Puppet-dev] [PATCH/puppet 1/1] (#4487) Stringify Environment obj in ActiveRecord.

2011-03-03 Thread Richard Crowley
When environment strings are read out of the storeconfigs database, they're eventually converted up to Puppet::Node::Environment objects. When these objects are returned to the storeconfigs database, ActiveRecord dumps them as YAML, which begins the death-spiral of YAML. Signed-off-by: Richard

[Puppet-dev] Re: [Puppet Users] ANNOUNCE: Puppet 2.6.6 - Release Candidate 1 available!

2011-03-03 Thread Stig Sandbeck Mathisen
Jacob Helwig writes: > This maintenance release fixes two issues with Puppet 2.6.5. To help with testing on Debian or Ubuntu, I've updated the apt repo at: deb http://people.debian.org/~ssm/repo unstable main deb-src http://people.debian.org/~ssm/repo unstable main -- Stig Sandbeck Mathis