Skip to content

Instantly share code, notes, and snippets.

View SViccari's full-sized avatar

Stephanie Viccari SViccari

View GitHub Profile
@SViccari
SViccari / incorporating-runtime-data-on-ci.md
Last active April 7, 2022 16:14
Overview of how we're incorporating the RSpec runtime log data (using TeamCity as our CI service):

Overview of how we're incorporating the runtime log data (using TeamCity as our CI service):

  1. After a TeamCity build is completed, the runtime log file is stored in the Artifacts section for each build.
  2. Each new build runs a process that issues an API call to TeamCity. This API call looks for the latest, successful build and downloads the log file. That request something like this: HTTParty.get("#{team-city-uri}/builds/#{parameters-that-identify-a-completed-successful-build}/artifacts/content/parallel_rspec_runtime.log")
  3. After fetching the file, we read the file, remove any uwanted noise caused by stdout, and write the results to a new file.
  4. When calling parallel_tests, we pass the new file(1). Example: parallel_rspec --group-by runtime --runtime-log /logs/parallel_rspec_runtime.log -- path_to_spec_files

(1) Word of caution, Parallel Tests states that "when a runtime log is filled" the default group_by strategy is runtime. However, after digging into the source of the gem, we found t