- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我有带有 cucumber 功能的 Rails 4 应用程序。在一些测试中,我考虑了 sphinx 数据,例如:
@javascript @sphinx
Feature: Edit a service
Scenario: Editing
Given I exist as an "individual"
And I have few services as individual user
And Sphinx indexes all models
...
Then I should see I18n translation for key "views.messages.notices.add.updated"
@sphinx
钩子(Hook)包含以下逻辑:
Before('@sphinx') do
self.use_transactional_fixtures = false
ThinkingSphinx::Test.start
sleep 2 # Give some time for sphinx to start.
end
After('@sphinx') do
ThinkingSphinx::Test.stop
self.use_transactional_fixtures = true
end
Sphinx 索引所有模型
包含以下内容:
Given(/^Sphinx indexes all models$/) do
ThinkingSphinx::Test.index
# Wait for Sphinx to finish loading in the new index files.
sleep 0.25 until index_finished?
end
这是database.yml
:
development:
adapter: postgresql
database: my-project_development
host: localhost
encoding: UTF8
pool: 5
test: &test
adapter: postgresql
database: my-project_test<%= ENV['TEST_ENV_NUMBER'] %>
username: my-project
password: my-project
host: localhost
encoding: UTF8
pool: 15
当我通过 rake parallel:features
(通过 parallel_tests )运行我的规范时,思考 sphinx 的规范总是失败:
Can't connect to MySQL server on '127.0.0.1' (61) (ThinkingSphinx::ConnectionError)
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/connection.rb:90:in `rescue in query'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/connection.rb:93:in `query'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/connection.rb:75:in `query_all'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/search/batch_inquirer.rb:17:in `block in results'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/connection.rb:37:in `block in take'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/innertube-1.1.0/lib/innertube.rb:138:in `take'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/connection.rb:35:in `take'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/search/batch_inquirer.rb:16:in `results'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/middlewares/inquirer.rb:9:in `block in call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/notifications.rb:159:in `block in instrument'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/notifications.rb:159:in `instrument'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/search/context.rb:22:in `log'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/middlewares/inquirer.rb:8:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/middlewares/geographer.rb:11:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/middlewares/sphinxql.rb:14:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/middleware-0.1.0/lib/middleware/runner.rb:31:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/middleware-0.1.0/lib/middleware/builder.rb:102:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/search.rb:67:in `populate'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/thinking-sphinx-3.1.0/lib/thinking_sphinx/search.rb:113:in `method_missing'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/squeel-1.1.1/lib/squeel/adapters/active_record/relation_extensions.rb:323:in `hash'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/squeel-1.1.1/lib/squeel/adapters/active_record/relation_extensions.rb:323:in `-'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/squeel-1.1.1/lib/squeel/adapters/active_record/relation_extensions.rb:323:in `merge_resolving_duplicate_squeel_equalities'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/squeel-1.1.1/lib/squeel/adapters/active_record/relation_extensions.rb:45:in `merge'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/relation.rb:555:in `with_default_scope'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/relation.rb:582:in `exec_queries'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/relation.rb:471:in `load'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/relation.rb:220:in `to_a'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/relation.rb:565:in `blank?'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/core_ext/object/blank.rb:20:in `present?'
/Users/serj/Projects/my-project/app/controllers/services_controller.rb:90:in `find_services'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:537:in `_run__1953055605195034856__process_action__callbacks'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/abstract_controller/callbacks.rb:17:in `process_action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal/rescue.rb:29:in `process_action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/notifications.rb:159:in `block in instrument'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/notifications.rb:159:in `instrument'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal/params_wrapper.rb:245:in `process_action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/abstract_controller/base.rb:136:in `process'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/abstract_controller/rendering.rb:44:in `process'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal.rb:195:in `dispatch'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_controller/metal.rb:231:in `block in action'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:80:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:48:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/journey/router.rb:71:in `block in call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/journey/router.rb:59:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/journey/router.rb:59:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/routing/route_set.rb:680:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-pjax-0.7.0/lib/rack/pjax.rb:12:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/request_store-1.0.5/lib/request_store/middleware.rb:9:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/simple_captcha2-0.2.1/lib/simple_captcha/middleware.rb:20:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/conditionalget.rb:25:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/remotipart-1.2.1/lib/remotipart/middleware.rb:27:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/flash.rb:241:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/cookies.rb:486:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/query_cache.rb:36:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activerecord-4.0.3/lib/active_record/connection_adapters/abstract/connection_pool.rb:626:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:373:in `_run__4201420912784056511__call__callbacks'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/callbacks.rb:80:in `run_callbacks'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/cucumber-rails-1.4.0/lib/cucumber/rails/action_controller.rb:10:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/railties-4.0.3/lib/rails/rack/logger.rb:38:in `call_app'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `block in call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:67:in `block in tagged'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:25:in `tagged'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/tagged_logging.rb:67:in `tagged'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/railties-4.0.3/lib/rails/rack/logger.rb:20:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/activesupport-4.0.3/lib/active_support/cache/strategy/local_cache.rb:83:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/actionpack-4.0.3/lib/action_dispatch/middleware/static.rb:64:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/railties-4.0.3/lib/rails/engine.rb:511:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/railties-4.0.3/lib/rails/application.rb:97:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/capybara-2.2.1/lib/capybara/server.rb:19:in `call'
/Users/serj/.rvm/gems/ruby-2.0.0-p353@my-project/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/serj/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
但是如果我在非并行模式下运行这些失败的测试(我的意思是 cucumber path/to/my/test.rb
),它会起作用(是的,parallel_tests
适用于其他测试)。我该如何解决这个问题?
最佳答案
您需要配置 config/thinking_sphinx.yml
以在 Sphinx 文件的路径中包含该环境变量 TEST_ENV_NUMBER
- deployment page 中列出的设置文档的数量应该是所需要的,加上端口号(mysql41 设置)。也许是这样的?
test:
mysql41: <%= ENV['TEST_ENV_NUMBER'].to_i + 9307 %>
pid_file: /path/to/app/tmp/searchd.<%= ENV['TEST_ENV_NUMBER' %>.pid
indices_location: /path/to/app/db/sphinx/<%= ENV['TEST_ENV_NUMBER' %>
configuration_file: /path/to/app/config/test.<%= ENV['TEST_ENV_NUMBER' %>.sphinx.conf
binlog_path: /path/to/app/db/sphinx/<%= ENV['TEST_ENV_NUMBER' %>/binlog
我自己没有使用过这种方法(或 parallel_test
),所以这当然是猜测,但值得一试。
关于ruby-on-rails - 如何在 cucumber 测试中集成 parallel_test 和 thinking sphinx?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23339607/
Windows 集成 (NTLM) 身份验证和 Windows 集成 (Kerberos) 之间有什么区别? 如何在IIS6中实现这些 w.r.t. MSDN 最佳答案 Kerberos 和 NTLM
Keycloak是一个用 Java 编写的开源身份验证和身份管理解决方案。它提供了一个nodejs适配器,使用它我能够成功地与express集成。这是有效的路由文件: 'use strict'
这是我关于 Bamboo 的第二个问题 ( My First One )。阅读建议信息后我的理解是,我需要一个构建工具,例如 nAnt 或 MSbuild 来编写一个获取源代码并构建它的脚本(我正在开
可用于将第三方应用程序与 jira 4.3 集成的身份验证方案有哪些?显然,从客户那里获取用户名和密码听起来很荒谬。另外,我知道 oauth 身份验证仅适用于版本 5。请告诉我。谢谢。 附注。我不是在
我有一个使用 DDS 的旧版 C++ 应用程序用于异步通信/消息传递。我需要将此应用程序集成到使用 JMS 进行消息传递的 JavaEE 环境中。除了构建独立的 JMS/DDS 桥接模块之外,我还有其
我正在尝试使用 Whatsapp 发送测试消息,但收到此错误消息: "error":{"code":27,"description":"Recipient not available on chann
我想将 photologue 与我的 Django 应用程序集成,并使用它在车辆库存中显示照片......有点像 Boost Motor Group Inc. 提供的内容。我已经集成了该应用程序,所以
我目前正在尝试弄清楚如何与 fujitsu scansnap 扫描仪集成,但没有从 fujitsu 找到有关 fujitsu scansnap 管理器如何调用您的应用程序并将文件发送到您的应用程序的详
在我的项目中,我使用了 9 个(九个)int-ip:udp-inbound-channel-adapter 和一个 jms:inbound-channel-adapter。 Jms 适配器从服务器接收
在我们当前的原型(prototype)中,大多数标准 HTML 控件都被小程序取代,最重要的是表单提交由小程序触发。 有没有一种方法可以像 一样在服务器端调用关联的操作 ? 本文Applet and
是否可以使用 twilio 号码从 whatsapp 发送/接收短信?有人用whatsapp试过twilio吗?我问过客服,如果可能的话,他说,不确定,但很多人都问过这个问题。 最佳答案 万一其他人来
我们办公室中几乎不存在版本控制,这显然导致了很多麻烦。我们想使用SVN和Notepad++进行设置...任何人都对如何实现此目标有任何想法?我已经开始研究并浏览了这个网站: http://www.sw
曾经有提供这种集成的 spring-modules 项目;但是,该项目现已弃用。现在有没有人继续支持这种集成?谢谢。 最佳答案 工作正在进行中。 http://blog.athico.com/sear
我的理解是,根据 http://wiki.dbpedia.org/Datasets,DBpedia 从 YAGO 获取类层次结构,而不是实体。 .但是,类似 http://dbpedia.org/cl
任何人都可以帮助我如何将 OpenCMS 与 Java Spring Web 应用程序集成。已经用谷歌搜索并浏览了很多网站但没有用。所以,请帮助我。 最佳答案 我认为将 SpringMVC 与 Ope
我正在尝试使用新的 migs getaway (MPGS) 我遵循了下一个 url 中的代码 https://ap-gateway.mastercard.com/api/documentation/i
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 4年前关闭。 Improve thi
我有一个 cmake 项目。我想轻松完成以下操作 搜索光标下任何变量、函数等的声明、定义和引用,这些可能在外部头文件中声明,其路径是在CMakeLists.txt中使用INCLUDE_DIRECTOR
有人能给我指点一下 Objective-C(或 c/c++)库的方向,或者教通过 FTP 上传或下载的教程(Objective-C)吗?最好能展示如何将文件下载到临时目录,然后稍后上传?我不介意针对
集成()给出了非常错误的答案: integrate(function (x) dnorm(x, -5, 0.07), -Inf, Inf, subdivisions = 10000L) # 2.127
我是一名优秀的程序员,十分优秀!