The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com
https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:
`rake spec` ignores a failing test
|Status:||Merged - Pending Release||Start date:||01/12/2012|
|Assignee:||Aaron Stone||% Done:|
|Branch:||Affected Dashboard version:|
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.
#2 Updated by Aaron Stone almost 3 years 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.