From 447c076517b7b30326c2b73e53a71396d179a9f9 Mon Sep 17 00:00:00 2001 From: Julien Bourdeau Date: Thu, 6 Mar 2025 16:01:29 +0100 Subject: [PATCH] chore(ci): Experiement with Knapsack Pro --- .github/workflows/spec.yml | 13 ++++++++++++- Gemfile | 1 + spec/spec_helper.rb | 4 ++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index b7dd2e0b489..d43d8292b50 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -28,6 +28,12 @@ jobs: --health-timeout 5s --health-retries 5 + strategy: + fail-fast: false + matrix: + ci_node_total: [ 2 ] + ci_node_index: [ 0, 1 ] + env: RAILS_ENV: test DATABASE_URL: "postgres://lago:lago@localhost:5432/lago" @@ -66,4 +72,9 @@ jobs: - name: Dump Clickhouse database schema run: bin/rails db:schema:dump:clickhouse - name: Run tests - run: bundle exec rspec + env: + KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC: ${{ secrets.KNAPSACK_PRO_TEST_SUITE_TOKEN_RSPEC }} + KNAPSACK_PRO_CI_NODE_TOTAL: ${{ matrix.ci_node_total }} + KNAPSACK_PRO_CI_NODE_INDEX: ${{ matrix.ci_node_index }} + KNAPSACK_PRO_LOG_LEVEL: info + run: bundle exec rake knapsack_pro:queue:rspec diff --git a/Gemfile b/Gemfile index 49d750f2ed3..11c593c27ba 100644 --- a/Gemfile +++ b/Gemfile @@ -117,6 +117,7 @@ group :development, :test do gem "rubocop-rspec", require: false gem "rubocop-thread_safety", require: false gem "awesome_print" + gem "knapsack_pro" end group :test do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7a5b1712189..33480d59f3c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -16,6 +16,10 @@ require "money-rails/test_helpers" require "active_storage_validations/matchers" +require 'knapsack_pro' + +KnapsackPro::Adapters::RSpecAdapter.bind + DatabaseCleaner.allow_remote_database_url = true SimpleCov.start do