The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #11928

`rake spec` ignores a failing test

Added by Matt Robinson over 2 years ago. Updated over 1 year ago.

Status:Merged - Pending ReleaseStart date:01/12/2012
Priority:NormalDue date:
Assignee:Aaron Stone% Done:

0%

Category:-
Target version:1.2.19
Keywords: Affected URL:
Branch: Affected Dashboard version:

Description

If you run rake spec all the tests pass. However, if you run ./script/spec spec, there is one test failure.

1) 'ResourceStatus when searching for file resources.latest_inspections should only return statuses from reports that are the latest inspect report for their node'FAILED
expected: [#<ResourceStatus id: 943, report_id: 901, resource_type: "File", title: "/etc/hosts", evaluation_time: nil, file: nil, line: nil, tags: nil, time: nil, change_count: nil, out_of_sync_count: nil, skipped: nil, failed: nil, status: nil>],
got: [#<ResourceStatus id: 943, report_id: 901, resource_type: "File", title: "/etc/hosts", evaluation_time: nil, file: nil, line: nil, tags: nil, time: nil, change_count: nil, out_of_sync_count: nil, skipped: nil, failed: nil, status: nil>] (using =~)
./spec/models/resource_status_spec.rb:53:
./script/spec:10:

It’s a legitimate failure although it’s not obvious why. The problem is that we’re using =~ to compare two objects which look like arrays, but one of them is a ActiveRecord::NamedScope::Scope for which =~ is not a defined rspec matcher. The spec is easy to fix (either to_a the objects first or just use == to compare), but really the question is why is the rake task not reporting a failed test.


Related issues

Related to Puppet Dashboard - Bug #5879: url column on nodes should go away Closed 01/13/2011

History

#1 Updated by Aaron Stone over 1 year ago

  • Status changed from Accepted to In Topic Branch Pending Review
  • Assignee set to Aaron Stone

Absolutely right! https://github.com/puppetlabs/puppet-dashboard/pull/153

#2 Updated by Aaron Stone over 1 year ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version set to 1.2.18

I don’t know why the failure is skipped when running tests locally, but I did see the problem on Travis and in the Rails 3 branch. Spec fix is merged.

#3 Updated by Matthaus Owens over 1 year ago

  • Target version changed from 1.2.18 to 1.2.19

Also available in: Atom PDF