Jason K
Jason K

Reputation: 155

using gitlab-development-kit, spec tests fail

The date is/was 12/17/2014, I'm trying to run gitlab-ce tests from within gitlab-development-kit. I'm hoping someone familiar with gitlab-ce development can help here. I want to have the tests pass before I begin development. I'm not sure if this warrants a bug report, it may be my environment (CentOS 6.5, rvm 1.26.3, ruby 2.1.3p242 )

I followed instructions on gitlab-development-kit to clone it, run make (to download latest gitlab + gitlab-shell).

I run bundle exec foreman start, redis and pgsql start.

Every thing is looking good, I ran gitlab and it worked fine in development env. I reset everything by recloning and following steps and then tested.

Within ./gitlab, I run "rake gitlab:test"; lots of passed, green tests. Until I the end, I receive this:

...(many, and all, passing tests above here)...
Scenario: Navigate to project feed
    ✔  Given I sign in as a user                    # features/steps/shared/authentication.rb:7
    ✔  And I own a project                          # features/steps/shared/project.rb:5
    ✔  And I visit my project's home page           # features/steps/shared/paths.rb:169
    ✔  Given I visit my project's files page        # features/steps/shared/paths.rb:177
    ✔  Given I press "g" and "p"                    # features/steps/shared/shortcuts.rb:4
    ✔  Then the active main tab should be Home      # features/steps/shared/project_tab.rb:7
/usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:436:in `partial_path': 'nil' is not an ActiveModel-compatible object. It must implement :to_partial_path. (ActionView::Template::Error)
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:345:in `setup'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:262:in `render'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/renderer.rb:47:in `render_partial'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/helpers/rendering_helper.rb:35:in `render'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers/action_view_mods.rb:10:in `block in render_with_haml'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers.rb:89:in `non_haml'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers/action_view_mods.rb:10:in `render_with_haml'
        from /home/git/gitlab-development-kit/gitlab/app/views/projects/blob/_blob.html.haml:20:in `_app_views_projects_blob__blob_html_haml__1171767312904667641_107433960'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:145:in `block in render'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.1.1/lib/active_support/notifications.rb:161:in `instrument'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:339:in `instrument'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:143:in `render'
        from /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:306:in `render_partial'
...

When I inspect app/views/projects/blob/_blob.html.haml:20 I can see

%ul.blob-commit-info.bs-callout.bs-callout-info.hidden-xs
  - blob_commit = @repository.last_commit_for_path(@commit.id, @blob.path)
  = render blob_commit, project: @project

The error is complaining because blob_commit is nil, from the line @repository.last_commit_for_path(@commit.id, @blob.path)

This is a pure clone of everything, I haven't began to make modifications yet. I waited a day to see if maybe the next update would fix things but it hasn't. I don't want to start a feature branch if I'm already having failing tests.

Upvotes: 0

Views: 196

Answers (1)

Jason K
Jason K

Reputation: 155

I found out the answer to my problem.

CentOS 6.5 hasn't upgraded their git rpm to anything beyond 1.7.1

I added some debugging to app/models/repository.rb, in def commit(id = HEAD), and def last_commit_for_path(sha, path)

It appears that in last_commit_for_path, on gitlab-test_bare, the following command is run:

git rev-list --max-count 1 5937ac0a7beb003549fc5fd26fc247adbce4a52e -- CHANGELOG

which results in an exception

fatal: bad revision '1'

which results in '@'repository.last_commit line above to assign nil to blob_commit.

It looks like --max-count 1, in my environment, must be --max-count=1.

git rev-list --max-count=1 5937ac0a7beb003549fc5fd26fc247adbce4a52e -- CHANGELOG

which results in a valid commit sha

913c66a37b4a45b9769037c55c2d238bd0942d2e

When I looked at my git version, i noticed it was extremely out of date (1.7 vs 2.2) so I updated using source and the tests pass since gitlab can execute the --max-count 1 as a parameter to git.

Upvotes: 0

Related Questions