Bug #3308

Unit tests failing: NoMethodError: undefined method `fakedata' for

Added by Mathias Gug almost 2 years ago. Updated almost 2 years ago.

Status:Accepted Start date:02/27/2010
Priority:Low Due date:
Assignee:- % Done:

0%

Category:testing
Target version:-
Affected Puppet version:0.25.4 Branch:
Keywords:
Votes: 0

Description

While trying to run the puppet testsuite on Ubuntu Lucid the following error was thrown:

2) Error:

test_data(TestCronParsedProvider):
NoMethodError: undefined method `fakedata' for #<TestCronParsedProvider:0x7f8c7903a770>
./ral/providers/cron/crontab.rb:491:in `test_data'
/usr/lib/ruby/1.8/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `__send__'
/usr/lib/ruby/1.8/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `run'

There are other similar errors in the log. I’ve attached the complete log.

To reproduce:

  1. Install the puppet-testsuite package on Ubuntu Lucid
  2. cd /usr/share/puppet-testsuite/
  3. sudo rake

errors.fakedata.log - Complete fakedata error log (2.3 kB) Mathias Gug, 02/27/2010 01:53 am


Related issues

related to Puppet - Refactor #2969: Convert Test::Unit tests to RSpec Accepted 12/20/2009
related to Puppet - Bug #3077: Some of the unit tests in the test (not spec) directory w... Closed 01/16/2010

History

Updated by Markus Roberts almost 2 years ago

  • Category set to testing
  • Status changed from Unreviewed to Accepted
  • Priority changed from Normal to Low

Note that these are errors in the older unit tests not the current spec/unit tests. The correct resolution is to bring the tests up to date (#2969).

Updated by Mathias Gug almost 2 years ago

Now that the test is supposed to be converted to spec/ unit tests, it fails with the following error:

2) Error: test_data(TestCronParsedProvider): Puppet::DevError: No fakedata matching /usr/share/test/data/providers/cron/examples/*

/usr/share/puppet-testsuite/lib/puppettest/support/utils.rb:160:in `fakedata'
./ral/providers/cron/crontab.rb:491:in `test_data'
/usr/lib/ruby/1.8/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `__send__'
/usr/lib/ruby/1.8/mocha/integration/test_unit/ruby_version_186_and_above.rb:19:in `run'

Updated by Mathias Gug almost 2 years ago

Upon more investigation this is due to the location of the test suite under lucid. The puppet-testsuite package installs the suite user /usr/share/puppet-testsuite instead of /usr/share/test as expected by the upstream code.

Also available in: Atom PDF