Project

ci_logger

0.01
The project is in a healthy, maintained state
Faster logger for CI
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 6.1.0
 Project Readme

CiLogger

In our CI process, we often look at logs to figure out issues with flaky tests—tests that fail sometimes but not always, especially when we can't make them fail in the same way on our own computers. The problem is, it's hard to tell which logs are about the failed tests because logs from tests that passed and failed are all mixed together.

CiLogger makes this easier by only keeping logs from tests that didn't pass, including the tricky flaky ones. This means when a flaky test won't fail the same way for us locally, we can quickly find and look at the right logs to help us understand and fix the problem.

prerequisite

  • rspec or minitest
  • rails(>= 6.1)

Installation

Add this line to your application's Gemfile:

gem 'ci_logger', group: :test

And then execute:

$ bundle

Or install it yourself as:

$ gem install ci_logger

Add this line to your config/environments/test.rb

config.ci_logger.enabled = ENV['CI']

You can replace ENV['CI'] with what you like.

Replace loggers besides rails logger

CiLogger replaces Rails.logger by default, but other loggers can be replaced.

your_logger = CiLogger.new(your_logger)
your_logger.debug('debug!') # This is only output when the test fails

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.