Jasmine-headless-webkit,带防护(1.0.0)和 Rails 3.2;资产编译真的很慢

发布于 2025-01-03 10:29:22 字数 1530 浏览 1 评论 0原文

基本上,当我保存文件(coffeescript)时,guard 会编译资产,然后运行与该文件相关的测试。此资源编译可能需要大约 20 秒。 Guard 打印以下内容:

Compiling rails assets with Guard::RailsAssets::RailsRunner.
rm -rf /Users/me/work/proj/public/assets
Assets compiled.

我刚刚升级了所有内容,在旧系统上,测试几乎立即运行。我不知道在哪里寻找解决减速问题的方法。

我正在使用:

  • guard(1.0.0)
  • guard-jasmine-headless-webkit(0.3.2)
  • guard-rails-assets(0.1.3)
  • rails(3.2.1)
  • jasmine(1.1.2)
  • jasmine-headless-webkit (0.8.4)

以前,我使用的是:

  • guard(0.6.2)
  • guard-jasmine-headless-webkit(0.3.2)
  • Guard-rails-assets(0.0.7)
  • rails(3.1.0)
  • jasmine(1.0.2.1)
  • jasmine-headless-webkit(0.8.0)

我的guardfile有以下内容:

group 'frontend' do
  guard 'rails-assets' do
    watch('config/application.rb')
    watch(%r{^app/assets/javascripts/.*\.(js|coffee)$})
  end

  guard 'jasmine-headless-webkit', :full_run => false, :all_on_start => false do
    watch('spec/javascripts/support/jasmine.yml')  { |m| "spec/javascripts" }
    watch(%r{^app/assets/javascripts/(.*)\.(js|coffee)$}) do |m|
      # Don't run tests if there was a failure compiling the JS
      if Dir["public/assets/editor.js"].any?
        specific_file = newest_js_file("spec/javascripts/#{m[1]}")
        all_tests = "spec/javascripts"
        specific_file or all_tests
      end
    end
    watch(%r{^spec/javascripts/.*\.(js|coffee)$})
  end
end

这种减速正在扼杀我的流量。如果您需要更多信息,请告诉我。

Basically, when I save a file (coffeescript), guard compiles the assets then runs the test(s) relating to the file. This asset compile can take ~20 seconds. Guard prints the following:

Compiling rails assets with Guard::RailsAssets::RailsRunner.
rm -rf /Users/me/work/proj/public/assets
Assets compiled.

I just upgraded everything, and on the old system, the tests ran almost instantly. I'm not sure where to look to fix the slowdown.

I'm using:

  • guard (1.0.0)
  • guard-jasmine-headless-webkit (0.3.2)
  • guard-rails-assets (0.1.3)
  • rails (3.2.1)
  • jasmine (1.1.2)
  • jasmine-headless-webkit (0.8.4)

Previously, I was using:

  • guard (0.6.2)
  • guard-jasmine-headless-webkit (0.3.2)
  • guard-rails-assets (0.0.7)
  • rails (3.1.0)
  • jasmine (1.0.2.1)
  • jasmine-headless-webkit (0.8.0)

My guardfile has the following:

group 'frontend' do
  guard 'rails-assets' do
    watch('config/application.rb')
    watch(%r{^app/assets/javascripts/.*\.(js|coffee)$})
  end

  guard 'jasmine-headless-webkit', :full_run => false, :all_on_start => false do
    watch('spec/javascripts/support/jasmine.yml')  { |m| "spec/javascripts" }
    watch(%r{^app/assets/javascripts/(.*)\.(js|coffee)$}) do |m|
      # Don't run tests if there was a failure compiling the JS
      if Dir["public/assets/editor.js"].any?
        specific_file = newest_js_file("spec/javascripts/#{m[1]}")
        all_tests = "spec/javascripts"
        specific_file or all_tests
      end
    end
    watch(%r{^spec/javascripts/.*\.(js|coffee)$})
  end
end

This slowdown is killing my flow. If you need anymore info, let me know.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文