Order-dependent failure in spec/models/todo_spec.rb
Began on https://gitlab.com/gitlab-org/gitlab-ce/commit/55447c09f96e7a1cfdb5f563c83ccfb5f14934dd but that was a docs-only change so the failure is likely due to test load order.
I'm currently unable to reproduce locally, even copying the test order due to other unrelated failures.
Failures:
1) Todo.for_target returns the todos for a given target
Failure/Error: expect(described_class.for_target(todo.target)).to eq([todo])
expected: [#<Todo id: 19, user_id: 316, project_id: 136, target_id: 43, target_type: "Issue", author_id: 316, a...18-11-30 18:14:23", updated_at: "2018-11-30 18:14:23", note_id: nil, commit_id: nil, group_id: nil>]
got: #<ActiveRecord::Relation [#<Todo id: 19, user_id: 316, project_id: 136, target_id: 43, target_type: "...8-11-30 18:14:23", updated_at: "2018-11-30 18:14:23", note_id: nil, commit_id: nil, group_id: nil>]>
(compared using ==)
Diff:
@@ -1,2 +1,29 @@
-[#<Todo id: 19, user_id: 316, project_id: 136, target_id: 43, target_type: "Issue", author_id: 316, action: 1, state: "pending", created_at: "2018-11-30 18:14:23", updated_at: "2018-11-30 18:14:23", note_id: nil, commit_id: nil, group_id: nil>]
+[#<Todo:0x00005615bc089af8
+ id: 19,
+ user_id: 316,
+ project_id: 136,
+ target_id: 43,
+ target_type: "Issue",
+ author_id: 316,
+ action: 1,
+ state: "pending",
+ created_at: Fri, 30 Nov 2018 18:14:23 UTC +00:00,
+ updated_at: Fri, 30 Nov 2018 18:14:23 UTC +00:00,
+ note_id: nil,
+ commit_id: nil,
+ group_id: nil>,
+ #<Todo:0x00005615bc089850
+ id: 20,
+ user_id: 318,
+ project_id: 138,
+ target_id: 43,
+ target_type: "MergeRequest",
+ author_id: 318,
+ action: 1,
+ state: "pending",
+ created_at: Fri, 30 Nov 2018 18:14:23 UTC +00:00,
+ updated_at: Fri, 30 Nov 2018 18:14:23 UTC +00:00,
+ note_id: nil,
+ commit_id: nil,
+ group_id: nil>]
# ./spec/models/todo_spec.rb:239:in `block (3 levels) in <top (required)>'
Finished in 12 minutes 3 seconds (files took 13.78 seconds to load)
767 examples, 1 failure, 3 pending
Failed examples:
rspec ./spec/models/todo_spec.rb:234 # Todo.for_target returns the todos for a given target
File order:
spec/features/profiles/user_edit_profile_spec.rb
spec/features/projects/files/user_browses_lfs_files_spec.rb
spec/features/projects/wiki/user_creates_wiki_page_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
spec/lib/gitlab/background_migration/create_gpg_key_subkeys_from_gpg_keys_spec.rb
spec/controllers/projects/notes_controller_spec.rb
spec/features/snippets/notes_on_personal_snippets_spec.rb
spec/features/search/user_searches_for_commits_spec.rb
spec/features/projects/settings/pipelines_settings_spec.rb
spec/models/todo_spec.rb
Edited by Robert Speicher