【问题标题】:using gitlab-development-kit, spec tests fail使用 gitlab-development-kit,规范测试失败
【发布时间】:2015-02-16 03:04:21
【问题描述】:

日期是/曾经是 12/17/2014,我正在尝试从 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”;许多通过的绿色测试。 直到我结束,我收到这个:

...(很多,所有,通过上面的测试)... 场景:导航到项目提要 ✔ 假设我以用户身份登录 # features/steps/shared/authentication.rb:7 ✔ 我拥有一个项目# features/steps/shared/project.rb:5 ✔ 我访问了我的项目主页# features/steps/shared/paths.rb:169 ✔ 鉴于我访问了我的项目的文件页面 # features/steps/shared/paths.rb:177 ✔ 假设我按“g”和“p”# features/steps/shared/shortcuts.rb:4 ✔ 然后活动的主选项卡应该是 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' 不是 ActiveModel 兼容的对象.它必须实现 :to_partial_path。 (动作视图::模板::错误) 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:345:in `setup' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/partial_renderer.rb:262:in `render' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/renderer/renderer.rb:47:in `render_partial' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/helpers/rendering_helper.rb:35:in `render' 来自 /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' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/haml-4.0.5/lib/haml/helpers.rb:89:in `non_haml' 来自 /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' 来自/home/git/gitlab-development-kit/gitlab/app/views/projects/blob/_blob.html.haml:20:in `_app_views_projects_blob__blob_html_haml__1171767312904667641_107433960' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:145:in `block in render' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/activesupport-4.1.1/lib/active_support/notifications.rb:161:in `instrument' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:339:in `instrument' 来自 /usr/local/rvm/gems/ruby-2.1.3/gems/actionview-4.1.1/lib/action_view/template.rb:143:in `render' 来自 /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) = 渲染 blob_commit,项目:@project

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

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

【问题讨论】:

  • 在黑暗中拍摄但:1) 使用bundle exec 运行每个命令,例如bundle exec rake gitlab:test。为它创建一个别名。 2) 测试数据库是否已正确播种?当您运行RAILS_ENV=test bundle exec rake gitlab:setup 时,它是否像开发一样顺利进行?
  • 是的,如果仍然失败,请考虑在gitlab.com/gitlab-org/gitlab-development-kit 上提出问题。 Vosmaer 通常会回答。
  • 谢谢,我使用 bash 脚本在 **/features 中查找所有 *.feature 文件,并找到了罪魁祸首: features/project/shortcuts.feature 对应于我收到的完全相同的错误完整的菠菜命令,但有 100% 的信心是文件有问题。我将把它移到错误报告中。我仍然认为它是环保的,所以它可能只是需要添加到我正在做或不做的文档中的东西。

标签: gitlab


【解决方案1】:

我找到了问题的答案。

CentOS 6.5 尚未将其 git rpm 升级到 1.7.1 以外的任何版本

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

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

git rev-list --max-count 1 5937ac0a7beb003549fc5fd26fc247adbce4a52e -- 变更日志

导致异常

致命:错误的修订版 '1'

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

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

git rev-list --max-count=1 5937ac0a7beb003549fc5fd26fc247adbce4a52e -- 变更日志

这会导致有效的提交 sha

913c66a37b4a45b9769037c55c2d238bd0942d2e

当我查看我的 git 版本时,我注意到它非常过时(1.7 与 2.2),因此我使用源代码进行了更新,并且测试通过了,因为 gitlab 可以执行 --max-count 1 作为 git 的参数。

【讨论】:

    猜你喜欢
    • 2021-08-28
    • 2019-04-19
    • 1970-01-01
    • 2018-06-05
    • 2018-12-17
    • 2017-11-14
    • 2016-09-06
    • 2021-04-19
    • 1970-01-01
    相关资源
    最近更新 更多