ruby-on-rails - Travis CI 上没有用于系统测试的输出
问题描述
在运行系统测试时,我在 Rails 6.0.4 应用程序上有一些奇怪的行为:rails test:system
在我的机器上运行时,我正确地看到哪个错误失败,但在 Travis 中我只看到以下内容,没有任何提示哪个错误失败:
Puma starting in single mode...
* Version 4.3.8 (ruby 2.6.6-p146), codename: Mysterious Traveller
* Min threads: 0, max threads: 4
* Environment: test
* Listening on tcp://127.0.0.1:34339
Use Ctrl-C to stop
The command "bundle exec rails test:system" exited with 1.
唯一让我想到的是并行化,但是我尝试了使用和不使用该parallelize
语句,test_helper.rb
但不幸的是,它并没有太大变化。
这是 .travis.yml 的内容:
language: ruby
cache: bundler
before_install:
- yes | gem update --system
- gem install bundler
env:
global:
# CodeClimate : INI
- COVERAGE=true
- secure: #..................
# CodeClimate : END
rvm:
- 2.6.6
services:
- mysql
- mongodb
addons:
apt:
sources:
- mysql-5.7-bionic
packages:
- mysql-server
dist: bionic
sudo: required
before_install:
- yes | gem update --system
- gem install bundler
before_script:
# needed for system testing
- sudo -- sh -c 'mkdir -p /var/run/puma/ && chown travis /var/run/puma/'
- sudo -- sh -c 'mkdir -p /var/log/puma/ && chown travis /var/log/puma/'
- sudo mysql_upgrade
- sudo service mysql restart
- RAILS_ENV=test bundle exec rake db:create db:schema:load
# CodeClimate : INI
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
# CodeClimate : END
script:
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then bundle exec rails checks:all; fi
- bundle exec rails test
- bundle exec rails test:system
after_script:
# CodeClimate : INI
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
# CodeClimate : END
notifications:
email:
- developers@company.com
有关如何解决此问题的任何提示?
解决方案
您是否尝试将以下内容添加到 .travis.yml:
addons:
chrome: stable
推荐阅读
- json - JSON Schema 要求不存在值
- database - 我可以对学生出勤 NoSQL 数据库进行哪些改进?
- aws-lambda - 在 Python 中从 AWS Lambda 访问 Oracle
- mongodb - 迄今为止的Mongodb字符串,空值问题
- c - 将大文件中的数据读取到C中的结构中
- git - 从詹金斯的工作中“拉”参数
- python - 鸭子打字用其他无用的语句(远程Pythonic)?
- php - 从 PHP Web 应用程序,从特定托盘自动打印?
- python - mixins 是否调用 super() 反模式?
- sql - 如果 Column 在值的末尾包含“-”,则删除末尾的“-” - sqldf