RSpec:对某些开发人员而非其他开发人员有效的失败测试进行故障排除
RSpec: Troubleshooting failing test that works for some devs and not others
希望有人可以指导我解决在 CI 和我的台式机上传递但在我的笔记本电脑 (MacBook) 上失败的失败规范。
这是失败:
$ rspec spec/features/media_files_spec.rb
Randomized with seed 39713
WARNING: The next major version of capybara-webkit will require at least version 5.0 of Qt. You're using version 4.8.7.
....F
Failures:
1) MediaFiles upload additional file to section
Failure/Error: expect(page).to have_css(".photoset .photo", count: 2)
expected to find css ".photoset .photo" 2 times, found 1 match: ""
# ./spec/features/media_files_spec.rb:43:in `block (2 levels) in <top (required)>'
# ./spec/support/background_jobs.rb:14:in `block (3 levels) in <top (required)>'
# ./spec/support/background_jobs.rb:5:in `run_background_jobs_immediately'
# ./spec/support/background_jobs.rb:13:in `block (2 levels) in <top (required)>'
Finished in 12 seconds (files took 3.03 seconds to load)
5 examples, 1 failure
Failed examples:
rspec ./spec/features/media_files_spec.rb:24 # MediaFiles upload additional file to section
我下周要去旅行,所以想稳定这台笔记本电脑,但不确定为什么在经过其他地方时会在本地出现故障?不知道从哪里开始。想法?
张贴我自己的答案,因为这可能对其他人有帮助。
原来这是我的 .env
在故障机器上的问题。一些 ENV 变量不同步。
坚韧不拔!
希望有人可以指导我解决在 CI 和我的台式机上传递但在我的笔记本电脑 (MacBook) 上失败的失败规范。
这是失败:
$ rspec spec/features/media_files_spec.rb
Randomized with seed 39713
WARNING: The next major version of capybara-webkit will require at least version 5.0 of Qt. You're using version 4.8.7.
....F
Failures:
1) MediaFiles upload additional file to section
Failure/Error: expect(page).to have_css(".photoset .photo", count: 2)
expected to find css ".photoset .photo" 2 times, found 1 match: ""
# ./spec/features/media_files_spec.rb:43:in `block (2 levels) in <top (required)>'
# ./spec/support/background_jobs.rb:14:in `block (3 levels) in <top (required)>'
# ./spec/support/background_jobs.rb:5:in `run_background_jobs_immediately'
# ./spec/support/background_jobs.rb:13:in `block (2 levels) in <top (required)>'
Finished in 12 seconds (files took 3.03 seconds to load)
5 examples, 1 failure
Failed examples:
rspec ./spec/features/media_files_spec.rb:24 # MediaFiles upload additional file to section
我下周要去旅行,所以想稳定这台笔记本电脑,但不确定为什么在经过其他地方时会在本地出现故障?不知道从哪里开始。想法?
张贴我自己的答案,因为这可能对其他人有帮助。
原来这是我的 .env
在故障机器上的问题。一些 ENV 变量不同步。
坚韧不拔!