使用gitlab-development-kit,规范测试失败

时间:2014-12-17 14:23:34

标签: gitlab

日期是/ 2014年12月17日,我试图从gitlab-development-kit中运行gitlab-ce测试。我希望熟悉gitlab-ce开发的人可以在这里提供帮助。我想在开始开发之前通过测试。我不确定这是否是一个错误报告,可能是我的环境(CentOS 6.5,rvm 1.26.3,ruby 2.1.3p242)

我按照gitlab-development-kit的说明克隆它,运行make(下载最新的gitlab + gitlab-shell)。

我运行bundle exec foreman start,redis和pgsql start。

每件事情看起来都很好,我运行了gitlab,它在开发环境中运行良好。我通过重新克隆并按照步骤重置所有内容,然后进行测试。

在./gitlab中,我运行" rake gitlab:test&#34 ;;很多通过的绿色测试。 直到我结束,我收到了这个:

...(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'
...

当我检查app / views / projects / blob / _blob.html.haml:20时 我可以看到

%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

错误是抱怨,因为blob_commit是行的nil      @ repository.last_commit_for_path(@ commit.id,@ blob.path)

这是一切的纯粹克隆,我还没有开始进行修改。我等了一天,看看下一次更新是否会解决问题,但它还没有。如果我已经有失败的测试,我不想创建一个功能分支。

1 个答案:

答案 0 :(得分:0)

我找到了问题的答案。

CentOS 6.5尚未将他们的git rpm升级到1.7.1之外的任何东西

我在def commit(id = HEAD)和def last_commit_for_path(sha,path)中为app / models / repository.rb添加了一些调试

似乎在last_commit_for_path中,在gitlab-test_bare上运行以下命令:

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

导致异常

致命:错误的修订'1'

导致上面的'@ owner.last_commit行将nil分配给blob_commit。

在我的环境中, - max-count 1看起来必须是--max-count = 1。

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

导致有效的提交sha

913c66a37b4a45b9769037c55c2d238bd0942d2e

当我查看我的git版本时,我注意到它已经过时了(1.7 vs 2.2)所以我更新了使用source并且测试通过,因为gitlab可以执行-max-count 1作为git的参数。