How to run fast RSpec tests on CircleCI with parallel jobs and have nice JUnit XML reports in CircleCI web UI

This page summarizes the projects mentioned and recommended in the original post on dev.to

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • rspec_junit_formatter

    RSpec results that your CI can read

  • rspec_junit_formatter - it’s a ruby gem that generates an XML report for executed tests with information about test failures. This report can be automatically read by CircleCI to present it in CircleCI web UI. No more browsing through long RSpec output - just look at highlighted failing specs in the TESTS tab :)

  • Knapsack

    Knapsack splits tests evenly across parallel CI nodes to run fast CI build and save you time. (by ArturT)

  • # Ruby CircleCI 2.0 configuration file # # Check https://circleci.com/docs/2.0/language-ruby/ for more details # version: 2 jobs: build: parallelism: 10 # https://circleci.com/docs/2.0/configuration-reference/#resource_class resource_class: small docker: # specify the version you desire here - image: circleci/ruby:2.7.1-node-browsers environment: PGHOST: 127.0.0.1 PGUSER: my_db_user RAILS_ENV: test # Split slow RSpec test files by test examples # https://knapsackpro.com/faq/question/how-to-split-slow-rspec-test-files-by-test-examples-by-individual-it KNAPSACK_PRO_RSPEC_SPLIT_BY_TEST_EXAMPLES: true # Specify service dependencies here if necessary # CircleCI maintains a library of pre-built images # documented at https://circleci.com/docs/2.0/circleci-images/ - image: circleci/postgres:10.6-alpine-ram environment: POSTGRES_DB: my_db_name POSTGRES_PASSWORD: "" POSTGRES_USER: my_db_user # Rails verifies Time Zone in DB is the same as time zone of the Rails app TZ: "Europe/Warsaw" - image: redis:6.0.7 working_directory: ~/repo environment: TZ: "Europe/Warsaw" steps: - checkout # Download and cache dependencies - restore_cache: keys: - v2-dependencies-bundler-{{ checksum "Gemfile.lock" }}-{{ checksum ".ruby-version" }} # fallback to using the latest cache if no exact match is found - v2-dependencies-bundler- - run: name: install ruby dependencies command: | bundle install --jobs=4 --retry=3 --path vendor/bundle - save_cache: paths: - ./vendor/bundle key: v2-dependencies-bundler-{{ checksum "Gemfile.lock" }}-{{ checksum ".ruby-version" }} # Database setup - run: bin/rails db:prepare - run: name: run tests command: | export CIRCLE_TEST_REPORTS=/tmp/test-results mkdir $CIRCLE_TEST_REPORTS bundle exec rake "knapsack_pro:queue:rspec[--format documentation --format RspecJunitFormatter --out tmp/rspec.xml]" # collect reports - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Run 1 hour test suite in 2 min with optimal parallelisation on existing CI infra

    1 project | news.ycombinator.com | 25 Oct 2022
  • How to improve a test suit made with Rspec, Capybara, FactoryBot and Siteprism

    2 projects | /r/ruby | 18 Jun 2022
  • puffing-billy VS vcr - a user suggested alternative

    2 projects | 7 Oct 2021
  • Six things you should consider while designing a test architecture

    1 project | dev.to | 23 Feb 2021
  • Spring: Rails Application Preloader

    1 project | news.ycombinator.com | 25 Apr 2024