Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
heptapod
heptapod
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 132
    • Issues 132
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

This instance will be upgraded to Heptapod 0.21.0rc2 on 2021-04-16 at 14:00 UTC+2 (a few minutes of down time)

  • heptapod
  • heptapodheptapod
  • Issues
  • #419

Closed
Open
Created Feb 08, 2021 by Georges Racinet@gracinet🦑Owner

CI: RSpec tests for project controllers

We should add some of the project controllers tests at least to the extended scope, but some fixes seem to be in order:

$ bin/rspec spec/controllers/projects/
(...)
Failures:

  1) Projects::GroupLinksController#update when `expires_at` is set returns correct json response
     Failure/Error: expect(json_response).to eq({ "expires_in" => "about 1 month", "expires_soon" => false })
     
       expected: {"expires_in"=>"about 1 month", "expires_soon"=>false}
            got: {"expires_in"=>"28 days", "expires_soon"=>false}
     
       (compared using ==)
     
       Diff:
       @@ -1,3 +1,3 @@
       -"expires_in" => "about 1 month",
       +"expires_in" => "28 days",
        "expires_soon" => false,
       
     # ./spec/controllers/projects/group_links_controller_spec.rb:176:in `block (4 levels) in <main>'
     # ./spec/spec_helper.rb:357:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:348:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:344:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:344:in `block (2 levels) in <top (required)>'

  2) Projects::MergeRequestsController GET pipelines with private builds on a public project from a project fork with private builds for the target project member does not respond with serialized pipelines
     Failure/Error: expect(json_response['pipelines']).to be_empty
       expected `[{"active"=>true, "commit"=>{"author"=>nil, "author_email"=>"job@gitlab.com", "author_gravatar_url"=>...push", "triggered"=>[], "triggered_by"=>nil, "updated_at"=>"2021-02-08T15:15:50.560Z", "user"=>nil}].empty?` to return true, got false
     # ./spec/controllers/projects/merge_requests_controller_spec.rb:792:in `block (7 levels) in <main>'
     # ./spec/spec_helper.rb:357:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:348:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:344:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:344:in `block (2 levels) in <top (required)>'
     # ./spec/support/sidekiq.rb:17:in `block (3 levels) in <main>'
     # ./spec/support/sidekiq.rb:8:in `gitlab_sidekiq_inline'
     # ./spec/support/sidekiq.rb:17:in `block (2 levels) in <main>'

  3) Projects::ProjectMembersController PUT update expiration date when `expires_at` is set returns correct json response
     Failure/Error:
       expect(json_response).to eq({
         "expires_in" => "about 1 month",
         "expires_soon" => false,
         "expires_at_formatted" => expiry_date.to_time.in_time_zone.to_s(:medium)
       })
     
       expected: {"expires_at_formatted"=>"Mar 7, 2021 11:00pm", "expires_in"=>"about 1 month", "expires_soon"=>false}
            got: {"expires_at_formatted"=>"Mar 7, 2021 11:00pm", "expires_in"=>"28 days", "expires_soon"=>false}
     
       (compared using ==)
     
       Diff:
       @@ -1,4 +1,4 @@
        "expires_at_formatted" => "Mar 7, 2021 11:00pm",
       -"expires_in" => "about 1 month",
       +"expires_in" => "28 days",
        "expires_soon" => false,
       
     # ./spec/controllers/projects/project_members_controller_spec.rb:252:in `block (5 levels) in <main>'
     # ./spec/spec_helper.rb:357:in `block (3 levels) in <top (required)>'
     # ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
     # ./spec/spec_helper.rb:348:in `block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:344:in `block (3 levels) in <top (required)>'
     # ./spec/spec_helper.rb:344:in `block (2 levels) in <top (required)>'

Finished in 17 minutes 51 seconds (files took 24.37 seconds to load)
2697 examples, 3 failures, 6 pending

The ones about 28 days are mere annoyances, the one about the unwanted pipeline needs more attention.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None