Method: CIRunner::Configuration::Project#buffer_starts_regex

Defined in:
lib/ci_runner/configuration/project.rb

#buffer_starts_regexnil, Regexp

This regex is used to tell CI Runner when to start buffering. The failures will then be matched agains this buffer rather than the whole log output. An example to better understand:

Examples:

An RSpec output looks like this:

   1.2) Failure/Error: @client.delete_repository(@repo.full_name)

        NoMethodError:
          undefined method `full_name' for nil:NilClass
        # ./spec/octokit/client/repositories_spec.rb:71:in `block (3 levels) in <top (required)>'
        # ./.bundle/gems/ruby/3.0.0/gems/webmock-3.14.0/lib/webmock/rspec.rb:37:in `block (2 levels) in'

Finished in 26.53 seconds (files took 1.26 seconds to load)
854 examples, 1 failure

Failed examples:

rspec ./spec/octokit/client/repository_spec.rb:75 # Octokit::Client::Repositories.edit_repository is_template

=====================

If you have this configuration set to "Failed examples:". CI Runner will start collecting test failures
only after the "Failed examples" line appear.

Storing this configuration

`cat myproject/.github/ci_runner.yml`

---
buffer_starts_regex: "Failed examples:"

Returns:

  • (nil, Regexp)

    Depending if the project has set this. CI Runner default will be used when not set.



131
132
133
# File 'lib/ci_runner/configuration/project.rb', line 131

def buffer_starts_regex
  to_regexp(@yaml_config.dig("buffer_starts_regex"))
end