From f07570e1037afff2cfde73504da150ced5ef7342 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 10:35:51 -0600 Subject: [PATCH 1/9] try breaking things up differently in multiverse --- .github/workflows/ci.yml | 250 +++++++++++++++++++++-- .github/workflows/ci_cron.yml | 244 +++++++++++++++++++--- test/multiverse/lib/multiverse/runner.rb | 8 +- 3 files changed, 456 insertions(+), 46 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5614ab5a87..09920a81bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,116 @@ jobs: multiverse: + needs: run_rubocop + runs-on: ubuntu-22.04 + image: redis + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + matrix: + multiverse: [agent, ai, background, background_2, frameworks, httpclients, httpclients_2, rails, rest] + ruby-version: [2.4.10, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + # This allows the cache in the following step to be able to write files to the directory needed for mysql + - if: matrix.ruby-version == '2.4.10' + name: Prepare mysql directory + run: sudo chown -R $USER /usr/local + + - if: matrix.ruby-version == '2.4.10' + name: Cache mysql55 + id: mysql55-cache + uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 + with: + path: /usr/local/mysql55 + key: mysql55-install + + - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' + name: Install mysql55 + run: sudo ./test/script/install_mysql55 + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + + + - name: Wait for/Check Mysql + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 1 + max_attempts: 20 + command: | + mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; + if [[ $? != 0 ]]; then + sleep 1; + fi + + + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="${{ matrix.multiverse }}"] + env: + VERBOSE_TEST_OUTPUT: true + MYSQL_PASSWORD: root + DB_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + COVERAGE: true + CI_FOR_PR: true + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate + + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} + path: lib/coverage_*/.resultset.json + retention-days: 2 + + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + retention-days: 2 + + + + multiverse_services_other: needs: run_rubocop runs-on: ubuntu-22.04 services: @@ -176,6 +286,124 @@ jobs: image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} ports: - 27017:27017 + rabbitmq: + image: rabbitmq:latest + ports: + - 5672:5672 + options: >- + --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + redis: + image: redis + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + matrix: + ruby-version: [2.4.10, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + # This allows the cache in the following step to be able to write files to the directory needed for mysql + # - if: matrix.ruby-version == '2.4.10' + # name: Prepare mysql directory + # run: sudo chown -R $USER /usr/local + + # - if: matrix.ruby-version == '2.4.10' + # name: Cache mysql55 + # id: mysql55-cache + # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 + # with: + # path: /usr/local/mysql55 + # key: mysql55-install + + # - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' + # name: Install mysql55 + # run: sudo ./test/script/install_mysql55 + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + + + # - name: Wait for/Check Mysql + # uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + # with: + # timeout_minutes: 1 + # max_attempts: 20 + # command: | + # mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; + # if [[ $? != 0 ]]; then + # sleep 1; + # fi + + + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="services"] + env: + VERBOSE_TEST_OUTPUT: true + MYSQL_PASSWORD: root + DB_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + COVERAGE: true + CI_FOR_PR: true + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate + + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} + path: lib/coverage_*/.resultset.json + retention-days: 2 + + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + retention-days: 2 + + multiverse_services_mysql_pg: + needs: run_rubocop + runs-on: ubuntu-22.04 + services: mysql: image: mysql:5.7 env: @@ -195,28 +423,9 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - rabbitmq: - image: rabbitmq:latest - ports: - - 5672:5672 - options: >- - --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - redis: - image: redis - ports: - - 6379:6379 - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 strategy: fail-fast: false matrix: - multiverse: [agent, ai, background, background_2, kafka, database, frameworks, httpclients, httpclients_2, rails, rest] ruby-version: [2.4.10, 3.4.1] steps: @@ -275,7 +484,7 @@ jobs: with: timeout_minutes: 60 max_attempts: 2 - command: bundle exec rake test:multiverse[group="${{ matrix.multiverse }}"] + command: bundle exec rake test:multiverse[group="services_2"] env: VERBOSE_TEST_OUTPUT: true MYSQL_PASSWORD: root @@ -311,6 +520,7 @@ jobs: retention-days: 2 + infinite_tracing: needs: run_rubocop runs-on: ubuntu-22.04 diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index a3a8ca809d..7975f626e6 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -124,6 +124,85 @@ jobs: multiverse: + runs-on: ubuntu-22.04 + strategy: + fail-fast: false + matrix: + multiverse: [agent, ai, background, background_2, frameworks, httpclients, httpclients_2, rails, rest] + ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + # - if: matrix.ruby-version == '2.4.10' + # name: Prepare mysql dirextory + # run: sudo chown -R $USER /usr/local + + # - if: matrix.ruby-version == '2.4.10' + # name: Cache mysql55 + # id: mysql55-cache + # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 + # with: + # path: /usr/local/mysql55 + # key: mysql55-install + + # - if: steps.mysql55-cache.outputs.cache-hit != 'true' && ( matrix.ruby-version == '2.4.10') + # name: Install mysql55 + # run: sudo ./test/script/install_mysql55 + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + + + # - name: Wait for/Check Mysql + # uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + # with: + # timeout_minutes: 1 + # max_attempts: 20 + # command: | + # mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; + # if [[ $? != 0 ]]; then + # sleep 1; + # fi + + + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="${{ matrix.multiverse }}"] + env: + VERBOSE_TEST_OUTPUT: true + DB_PASSWORD: root + MYSQL_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate + + multiverse_services_other: + needs: run_rubocop runs-on: ubuntu-22.04 services: elasticsearch7: @@ -138,7 +217,7 @@ jobs: --health-timeout 5s --health-retries 10 elasticsearch8: - image: elasticsearch:8.4.2 + image: elasticsearch:8.13.0 env: discovery.type: single-node xpack.security.enabled: false @@ -189,6 +268,123 @@ jobs: image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} ports: - 27017:27017 + rabbitmq: + image: rabbitmq:latest + ports: + - 5672:5672 + options: >- + --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + redis: + image: redis + ports: + - 6379:6379 + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + matrix: + ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] + # ruby-version: [2.4.10, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + # This allows the cache in the following step to be able to write files to the directory needed for mysql + # - if: matrix.ruby-version == '2.4.10' + # name: Prepare mysql directory + # run: sudo chown -R $USER /usr/local + + # - if: matrix.ruby-version == '2.4.10' + # name: Cache mysql55 + # id: mysql55-cache + # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 + # with: + # path: /usr/local/mysql55 + # key: mysql55-install + + # - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' + # name: Install mysql55 + # run: sudo ./test/script/install_mysql55 + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + + + # - name: Wait for/Check Mysql + # uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + # with: + # timeout_minutes: 1 + # max_attempts: 20 + # command: | + # mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; + # if [[ $? != 0 ]]; then + # sleep 1; + # fi + + + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="services"] + env: + VERBOSE_TEST_OUTPUT: true + DB_PASSWORD: root + MYSQL_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate + + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} + path: lib/coverage_*/.resultset.json + retention-days: 2 + + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + retention-days: 2 + + multiverse_services_mysql_pg: + needs: run_rubocop + runs-on: ubuntu-22.04 + services: mysql: image: mysql:5.7 env: @@ -208,29 +404,12 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - rabbitmq: - image: rabbitmq:latest - ports: - - 5672:5672 - options: >- - --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" - --health-interval 10s - --health-timeout 5s - --health-retries 5 - redis: - image: redis - ports: - - 6379:6379 - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 strategy: fail-fast: false matrix: - multiverse: [agent, ai, background, background_2, database, kafka, frameworks, httpclients, httpclients_2, rails, rest] ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] + # ruby-version: [2.4.10, 3.4.1] + steps: - name: Configure git run: 'git config --global init.defaultBranch main' @@ -247,8 +426,9 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} + # This allows the cache in the following step to be able to write files to the directory needed for mysql - if: matrix.ruby-version == '2.4.10' - name: Prepare mysql dirextory + name: Prepare mysql directory run: sudo chown -R $USER /usr/local - if: matrix.ruby-version == '2.4.10' @@ -259,7 +439,7 @@ jobs: path: /usr/local/mysql55 key: mysql55-install - - if: steps.mysql55-cache.outputs.cache-hit != 'true' && ( matrix.ruby-version == '2.4.10') + - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' name: Install mysql55 run: sudo ./test/script/install_mysql55 @@ -286,7 +466,7 @@ jobs: with: timeout_minutes: 60 max_attempts: 2 - command: bundle exec rake test:multiverse[group="${{ matrix.multiverse }}"] + command: bundle exec rake test:multiverse[group="services_2"] env: VERBOSE_TEST_OUTPUT: true DB_PASSWORD: root @@ -302,6 +482,24 @@ jobs: if: ${{ failure() }} uses: ./.github/actions/annotate + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} + path: lib/coverage_*/.resultset.json + retention-days: 2 + + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + retention-days: 2 + + infinite_tracing: runs-on: ubuntu-22.04 diff --git a/test/multiverse/lib/multiverse/runner.rb b/test/multiverse/lib/multiverse/runner.rb index a7470ed51e..aec6f6a9a1 100644 --- a/test/multiverse/lib/multiverse/runner.rb +++ b/test/multiverse/lib/multiverse/runner.rb @@ -102,9 +102,11 @@ def execute_suites(filter, opts) 'ai' => %w[ruby_openai], 'background' => %w[delayed_job sidekiq resque], 'background_2' => %w[rake], - 'kafka' => %w[rdkafka], - 'database' => %w[elasticsearch mongo redis sequel], - 'rails' => %w[active_record active_record_pg active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], + # 'kafka' => %w[rdkafka ruby_kafka], + 'services' => %w[elasticsearch mongo redis sequel bunny memcache rdkafka ruby_kafka], # needs github actions services, other than PG and mysql + 'services_2' => %w[active_record active_record_pg], # needs github actions services for mysql and pg + # 'database' => %w[elasticsearch mongo redis sequel], + 'rails' => %w[active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], 'frameworks' => %w[grape padrino roda sinatra], 'httpclients' => %w[async_http curb excon httpclient], 'httpclients_2' => %w[typhoeus net_http httprb ethon httpx], From 33d0284f6eacdf4c26d786467871942a2d299ce4 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 10:37:03 -0600 Subject: [PATCH 2/9] accidentally missed something --- .github/workflows/ci.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09920a81bb..184befb0d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,14 +112,6 @@ jobs: multiverse: needs: run_rubocop runs-on: ubuntu-22.04 - image: redis - ports: - - 6379:6379 - options: >- - --health-cmd "redis-cli ping" - --health-interval 10s - --health-timeout 5s - --health-retries 5 strategy: fail-fast: false matrix: From c96ee2765c6ad5f125cfa2f69adb97d49089c071 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 10:40:43 -0600 Subject: [PATCH 3/9] sidekiq uses redis --- test/multiverse/lib/multiverse/runner.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/multiverse/lib/multiverse/runner.rb b/test/multiverse/lib/multiverse/runner.rb index aec6f6a9a1..88520b1079 100644 --- a/test/multiverse/lib/multiverse/runner.rb +++ b/test/multiverse/lib/multiverse/runner.rb @@ -100,10 +100,10 @@ def execute_suites(filter, opts) GROUPS = { 'agent' => %w[agent_only bare config_file_loading deferred_instrumentation high_security no_json json marshalling thread yajl], 'ai' => %w[ruby_openai], - 'background' => %w[delayed_job sidekiq resque], + 'background' => %w[delayed_job resque], 'background_2' => %w[rake], # 'kafka' => %w[rdkafka ruby_kafka], - 'services' => %w[elasticsearch mongo redis sequel bunny memcache rdkafka ruby_kafka], # needs github actions services, other than PG and mysql + 'services' => %w[elasticsearch mongo redis sidekiq sequel bunny memcache rdkafka ruby_kafka], # needs github actions services, other than PG and mysql 'services_2' => %w[active_record active_record_pg], # needs github actions services for mysql and pg # 'database' => %w[elasticsearch mongo redis sequel], 'rails' => %w[active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], From 4db79948b2206755f975220af16a1098ac9ff692 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 10:49:10 -0600 Subject: [PATCH 4/9] delete steps not used in cron --- .github/workflows/ci_cron.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 7975f626e6..d272d052cb 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -364,22 +364,6 @@ jobs: if: ${{ failure() }} uses: ./.github/actions/annotate - - name: Save coverage results - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 - with: - name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} - path: lib/coverage_*/.resultset.json - retention-days: 2 - - - name: Generate gem manifest - run: rake test:multiverse:gem_manifest - - - name: Save gem manifest - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 - with: - name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json - path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json - retention-days: 2 multiverse_services_mysql_pg: needs: run_rubocop @@ -482,22 +466,6 @@ jobs: if: ${{ failure() }} uses: ./.github/actions/annotate - - name: Save coverage results - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 - with: - name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} - path: lib/coverage_*/.resultset.json - retention-days: 2 - - - name: Generate gem manifest - run: rake test:multiverse:gem_manifest - - - name: Save gem manifest - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 - with: - name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json - path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json - retention-days: 2 From f5c7041c70cb9a71bb668cf2bb48b51ae31f4ab2 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 11:10:24 -0600 Subject: [PATCH 5/9] reorganize things --- .github/workflows/ci.yml | 260 ++++++++++++++++------- .github/workflows/ci_cron.yml | 229 +++++++++++++------- test/multiverse/lib/multiverse/runner.rb | 13 +- 3 files changed, 341 insertions(+), 161 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 184befb0d4..b8c703a816 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,41 +134,11 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} - # This allows the cache in the following step to be able to write files to the directory needed for mysql - - if: matrix.ruby-version == '2.4.10' - name: Prepare mysql directory - run: sudo chown -R $USER /usr/local - - - if: matrix.ruby-version == '2.4.10' - name: Cache mysql55 - id: mysql55-cache - uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 - with: - path: /usr/local/mysql55 - key: mysql55-install - - - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' - name: Install mysql55 - run: sudo ./test/script/install_mysql55 - - name: Setup bundler run: ./.github/workflows/scripts/setup_bundler env: RUBY_VERSION: ${{ matrix.ruby-version }} - - - name: Wait for/Check Mysql - uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 - with: - timeout_minutes: 1 - max_attempts: 20 - command: | - mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; - if [[ $? != 0 ]]; then - sleep 1; - fi - - - name: Run Multiverse Tests uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: @@ -211,7 +181,7 @@ jobs: - multiverse_services_other: + multiverse_services_1: needs: run_rubocop runs-on: ubuntu-22.04 services: @@ -249,6 +219,90 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + mongodb: + image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} + ports: + - 27017:27017 + rabbitmq: + image: rabbitmq:latest + ports: + - 5672:5672 + options: >- + --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + matrix: + ruby-version: [2.4.10, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="services_1"] + env: + VERBOSE_TEST_OUTPUT: true + MYSQL_PASSWORD: root + DB_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + COVERAGE: true + CI_FOR_PR: true + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate + + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-services_1 + path: lib/coverage_*/.resultset.json + retention-days: 2 + + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_services_1.json + path: gem_manifest_${{ matrix.ruby-version }}_services_1.json + retention-days: 2 + + + multiverse_services_2: + needs: run_rubocop + runs-on: ubuntu-22.04 + services: kafka: image: bitnami/kafka ports: @@ -274,19 +328,6 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - mongodb: - image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} - ports: - - 27017:27017 - rabbitmq: - image: rabbitmq:latest - ports: - - 5672:5672 - options: >- - --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" - --health-interval 10s - --health-timeout 5s - --health-retries 5 redis: image: redis ports: @@ -317,47 +358,104 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} - # This allows the cache in the following step to be able to write files to the directory needed for mysql - # - if: matrix.ruby-version == '2.4.10' - # name: Prepare mysql directory - # run: sudo chown -R $USER /usr/local - - # - if: matrix.ruby-version == '2.4.10' - # name: Cache mysql55 - # id: mysql55-cache - # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 - # with: - # path: /usr/local/mysql55 - # key: mysql55-install - - # - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' - # name: Install mysql55 - # run: sudo ./test/script/install_mysql55 - - name: Setup bundler run: ./.github/workflows/scripts/setup_bundler env: RUBY_VERSION: ${{ matrix.ruby-version }} + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="services_2"] + env: + VERBOSE_TEST_OUTPUT: true + MYSQL_PASSWORD: root + DB_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + COVERAGE: true + CI_FOR_PR: true + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate - # - name: Wait for/Check Mysql - # uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 - # with: - # timeout_minutes: 1 - # max_attempts: 20 - # command: | - # mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; - # if [[ $? != 0 ]]; then - # sleep 1; - # fi + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-services_2 + path: lib/coverage_*/.resultset.json + retention-days: 2 + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_services_2.json + path: gem_manifest_${{ matrix.ruby-version }}_services_2.json + retention-days: 2 + + + multiverse_services_kafka: + needs: run_rubocop + runs-on: ubuntu-22.04 + services: + kafka: + image: bitnami/kafka + ports: + - 9092:9092 + options: >- + --health-cmd "kafka-broker-api-versions.sh --version" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 + ALLOW_PLAINTEXT_LISTENER: yes + KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE + KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092 + strategy: + fail-fast: false + matrix: + ruby-version: [2.4.10, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} - name: Run Multiverse Tests uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: timeout_minutes: 60 max_attempts: 2 - command: bundle exec rake test:multiverse[group="services"] + command: bundle exec rake test:multiverse[group="services_kafka"] env: VERBOSE_TEST_OUTPUT: true MYSQL_PASSWORD: root @@ -378,7 +476,7 @@ jobs: - name: Save coverage results uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 with: - name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} + name: coverage-report-multiverse-${{ matrix.ruby-version }}-services_kafka path: lib/coverage_*/.resultset.json retention-days: 2 @@ -388,10 +486,12 @@ jobs: - name: Save gem manifest uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 with: - name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json - path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + name: gem_manifest_${{ matrix.ruby-version }}_services_kafka.json + path: gem_manifest_${{ matrix.ruby-version }}_services_kafka.json retention-days: 2 + + multiverse_services_mysql_pg: needs: run_rubocop runs-on: ubuntu-22.04 @@ -458,7 +558,6 @@ jobs: env: RUBY_VERSION: ${{ matrix.ruby-version }} - - name: Wait for/Check Mysql uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: @@ -470,13 +569,12 @@ jobs: sleep 1; fi - - name: Run Multiverse Tests uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: timeout_minutes: 60 max_attempts: 2 - command: bundle exec rake test:multiverse[group="services_2"] + command: bundle exec rake test:multiverse[group="services_mysql_pg"] env: VERBOSE_TEST_OUTPUT: true MYSQL_PASSWORD: root @@ -497,7 +595,7 @@ jobs: - name: Save coverage results uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 with: - name: coverage-report-multiverse-${{ matrix.ruby-version }}-${{ matrix.multiverse }} + name: coverage-report-multiverse-${{ matrix.ruby-version }}-service_mysql_pg path: lib/coverage_*/.resultset.json retention-days: 2 @@ -507,8 +605,8 @@ jobs: - name: Save gem manifest uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 with: - name: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json - path: gem_manifest_${{ matrix.ruby-version }}_${{ matrix.multiverse }}.json + name: gem_manifest_${{ matrix.ruby-version }}_service_mysql_pg.json + path: gem_manifest_${{ matrix.ruby-version }}_service_mysql_pg.json retention-days: 2 diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index d272d052cb..0954838b6c 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -146,40 +146,11 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} - # - if: matrix.ruby-version == '2.4.10' - # name: Prepare mysql dirextory - # run: sudo chown -R $USER /usr/local - - # - if: matrix.ruby-version == '2.4.10' - # name: Cache mysql55 - # id: mysql55-cache - # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 - # with: - # path: /usr/local/mysql55 - # key: mysql55-install - - # - if: steps.mysql55-cache.outputs.cache-hit != 'true' && ( matrix.ruby-version == '2.4.10') - # name: Install mysql55 - # run: sudo ./test/script/install_mysql55 - - name: Setup bundler run: ./.github/workflows/scripts/setup_bundler env: RUBY_VERSION: ${{ matrix.ruby-version }} - - # - name: Wait for/Check Mysql - # uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 - # with: - # timeout_minutes: 1 - # max_attempts: 20 - # command: | - # mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; - # if [[ $? != 0 ]]; then - # sleep 1; - # fi - - - name: Run Multiverse Tests uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: @@ -201,7 +172,8 @@ jobs: if: ${{ failure() }} uses: ./.github/actions/annotate - multiverse_services_other: + + multiverse_services_1: needs: run_rubocop runs-on: ubuntu-22.04 services: @@ -239,6 +211,90 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 + mongodb: + image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} + ports: + - 27017:27017 + rabbitmq: + image: rabbitmq:latest + ports: + - 5672:5672 + options: >- + --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + strategy: + fail-fast: false + matrix: + ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="services_1"] + env: + VERBOSE_TEST_OUTPUT: true + MYSQL_PASSWORD: root + DB_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + COVERAGE: true + CI_FOR_PR: true + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate + + - name: Save coverage results + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: coverage-report-multiverse-${{ matrix.ruby-version }}-services_1 + path: lib/coverage_*/.resultset.json + retention-days: 2 + + - name: Generate gem manifest + run: rake test:multiverse:gem_manifest + + - name: Save gem manifest + uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 + with: + name: gem_manifest_${{ matrix.ruby-version }}_services_1.json + path: gem_manifest_${{ matrix.ruby-version }}_services_1.json + retention-days: 2 + + + multiverse_services_2: + needs: run_rubocop + runs-on: ubuntu-22.04 + services: kafka: image: bitnami/kafka ports: @@ -264,19 +320,6 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 5 - mongodb: - image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} - ports: - - 27017:27017 - rabbitmq: - image: rabbitmq:latest - ports: - - 5672:5672 - options: >- - --health-cmd "rabbitmq-diagnostics -q check_port_connectivity" - --health-interval 10s - --health-timeout 5s - --health-retries 5 redis: image: redis ports: @@ -290,7 +333,6 @@ jobs: fail-fast: false matrix: ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] - # ruby-version: [2.4.10, 3.4.1] steps: - name: Configure git @@ -308,47 +350,86 @@ jobs: with: ruby-version: ${{ matrix.ruby-version }} - # This allows the cache in the following step to be able to write files to the directory needed for mysql - # - if: matrix.ruby-version == '2.4.10' - # name: Prepare mysql directory - # run: sudo chown -R $USER /usr/local - - # - if: matrix.ruby-version == '2.4.10' - # name: Cache mysql55 - # id: mysql55-cache - # uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # tag v4.0.2 - # with: - # path: /usr/local/mysql55 - # key: mysql55-install - - # - if: steps.mysql55-cache.outputs.cache-hit != 'true' && matrix.ruby-version == '2.4.10' - # name: Install mysql55 - # run: sudo ./test/script/install_mysql55 - - name: Setup bundler run: ./.github/workflows/scripts/setup_bundler env: RUBY_VERSION: ${{ matrix.ruby-version }} + - name: Run Multiverse Tests + uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 + with: + timeout_minutes: 60 + max_attempts: 2 + command: bundle exec rake test:multiverse[group="services_2"] + env: + VERBOSE_TEST_OUTPUT: true + DB_PASSWORD: root + MYSQL_PASSWORD: root + DB_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} + MYSQL_HOST: 127.0.0.1 + POSTGRES_USERNAME: postgres + POSTGRES_PASSWORD: password + SERIALIZE: 1 + + - name: Annotate errors + if: ${{ failure() }} + uses: ./.github/actions/annotate - # - name: Wait for/Check Mysql - # uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 - # with: - # timeout_minutes: 1 - # max_attempts: 20 - # command: | - # mysql --host 127.0.0.1 --port ${{ job.services.mysql.ports[3306] }} -uroot -proot -e "SHOW GRANTS FOR 'root'@'localhost'"; - # if [[ $? != 0 ]]; then - # sleep 1; - # fi + multiverse_services_kafka: + needs: run_rubocop + runs-on: ubuntu-22.04 + services: + kafka: + image: bitnami/kafka + ports: + - 9092:9092 + options: >- + --health-cmd "kafka-broker-api-versions.sh --version" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + env: + KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181 + ALLOW_PLAINTEXT_LISTENER: yes + KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE + KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092 + strategy: + fail-fast: false + matrix: + ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] + + steps: + - name: Configure git + run: 'git config --global init.defaultBranch main' + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # tag v4.1.7 + + # - curl is needed for Curb + # - xslt is needed for older Nokogiris, RUBY_VERSION < 2.5 + # - sasl is needed for memcached + - name: Install OS packages + run: sudo apt-get update; sudo apt-get install -y --no-install-recommends libcurl4-nss-dev libsasl2-dev libxslt1-dev + + - name: Install Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@4a9ddd6f338a97768b8006bf671dfbad383215f4 # tag v1.207.0 + with: + ruby-version: ${{ matrix.ruby-version }} + + - name: Setup bundler + run: ./.github/workflows/scripts/setup_bundler + env: + RUBY_VERSION: ${{ matrix.ruby-version }} + - name: Run Multiverse Tests uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: timeout_minutes: 60 max_attempts: 2 - command: bundle exec rake test:multiverse[group="services"] + command: bundle exec rake test:multiverse[group="services_kafka"] env: VERBOSE_TEST_OUTPUT: true DB_PASSWORD: root @@ -392,7 +473,6 @@ jobs: fail-fast: false matrix: ruby-version: [2.4.10, 2.5.9, 2.6.10, 2.7.8, 3.0.7, 3.1.6, 3.2.6, 3.3.6, 3.4.1] - # ruby-version: [2.4.10, 3.4.1] steps: - name: Configure git @@ -444,13 +524,12 @@ jobs: sleep 1; fi - - name: Run Multiverse Tests uses: nick-fields/retry@7152eba30c6575329ac0576536151aca5a72780e # tag v3.0.0 with: timeout_minutes: 60 max_attempts: 2 - command: bundle exec rake test:multiverse[group="services_2"] + command: bundle exec rake test:multiverse[group="services_mysql_pg"] env: VERBOSE_TEST_OUTPUT: true DB_PASSWORD: root diff --git a/test/multiverse/lib/multiverse/runner.rb b/test/multiverse/lib/multiverse/runner.rb index 88520b1079..154ffcab00 100644 --- a/test/multiverse/lib/multiverse/runner.rb +++ b/test/multiverse/lib/multiverse/runner.rb @@ -102,14 +102,17 @@ def execute_suites(filter, opts) 'ai' => %w[ruby_openai], 'background' => %w[delayed_job resque], 'background_2' => %w[rake], - # 'kafka' => %w[rdkafka ruby_kafka], - 'services' => %w[elasticsearch mongo redis sidekiq sequel bunny memcache rdkafka ruby_kafka], # needs github actions services, other than PG and mysql - 'services_2' => %w[active_record active_record_pg], # needs github actions services for mysql and pg - # 'database' => %w[elasticsearch mongo redis sequel], - 'rails' => %w[active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], 'frameworks' => %w[grape padrino roda sinatra], 'httpclients' => %w[async_http curb excon httpclient], 'httpclients_2' => %w[typhoeus net_http httprb ethon httpx], + 'rails' => %w[active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], + + # these neede services running in github actions, so they are separated + 'services_1' => %w[elasticsearch mongo sequel bunny], + 'services_2' => %w[redis sidekiq memcache], + 'services_kafka' => %w[rdkafka ruby_kafka], + 'services_mysql_pg' => %w[active_record active_record_pg], + 'infinite_tracing' => %w[infinite_tracing], 'rest' => [] # Specially handled below From 920d20102c592794a785c797f64e92151780233a Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 11:14:12 -0600 Subject: [PATCH 6/9] remove extra env vars --- .github/workflows/ci.yml | 30 ---------------------- .github/workflows/ci_cron.yml | 47 ----------------------------------- 2 files changed, 77 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8c703a816..6eb72f76c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,13 +147,6 @@ jobs: command: bundle exec rake test:multiverse[group="${{ matrix.multiverse }}"] env: VERBOSE_TEST_OUTPUT: true - MYSQL_PASSWORD: root - DB_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 COVERAGE: true CI_FOR_PR: true @@ -266,13 +259,6 @@ jobs: command: bundle exec rake test:multiverse[group="services_1"] env: VERBOSE_TEST_OUTPUT: true - MYSQL_PASSWORD: root - DB_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 COVERAGE: true CI_FOR_PR: true @@ -371,13 +357,6 @@ jobs: command: bundle exec rake test:multiverse[group="services_2"] env: VERBOSE_TEST_OUTPUT: true - MYSQL_PASSWORD: root - DB_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 COVERAGE: true CI_FOR_PR: true @@ -458,13 +437,6 @@ jobs: command: bundle exec rake test:multiverse[group="services_kafka"] env: VERBOSE_TEST_OUTPUT: true - MYSQL_PASSWORD: root - DB_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 COVERAGE: true CI_FOR_PR: true @@ -491,7 +463,6 @@ jobs: retention-days: 2 - multiverse_services_mysql_pg: needs: run_rubocop runs-on: ubuntu-22.04 @@ -610,7 +581,6 @@ jobs: retention-days: 2 - infinite_tracing: needs: run_rubocop runs-on: ubuntu-22.04 diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index 0954838b6c..a8fb6fde52 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -159,13 +159,6 @@ jobs: command: bundle exec rake test:multiverse[group="${{ matrix.multiverse }}"] env: VERBOSE_TEST_OUTPUT: true - DB_PASSWORD: root - MYSQL_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 - name: Annotate errors @@ -258,38 +251,12 @@ jobs: command: bundle exec rake test:multiverse[group="services_1"] env: VERBOSE_TEST_OUTPUT: true - MYSQL_PASSWORD: root - DB_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 - COVERAGE: true - CI_FOR_PR: true - name: Annotate errors if: ${{ failure() }} uses: ./.github/actions/annotate - - name: Save coverage results - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 - with: - name: coverage-report-multiverse-${{ matrix.ruby-version }}-services_1 - path: lib/coverage_*/.resultset.json - retention-days: 2 - - - name: Generate gem manifest - run: rake test:multiverse:gem_manifest - - - name: Save gem manifest - uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # tag v4.3.4 - with: - name: gem_manifest_${{ matrix.ruby-version }}_services_1.json - path: gem_manifest_${{ matrix.ruby-version }}_services_1.json - retention-days: 2 - multiverse_services_2: needs: run_rubocop @@ -363,13 +330,6 @@ jobs: command: bundle exec rake test:multiverse[group="services_2"] env: VERBOSE_TEST_OUTPUT: true - DB_PASSWORD: root - MYSQL_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 - name: Annotate errors @@ -432,13 +392,6 @@ jobs: command: bundle exec rake test:multiverse[group="services_kafka"] env: VERBOSE_TEST_OUTPUT: true - DB_PASSWORD: root - MYSQL_PASSWORD: root - DB_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_PORT: ${{ job.services.mysql.ports[3306] }} - MYSQL_HOST: 127.0.0.1 - POSTGRES_USERNAME: postgres - POSTGRES_PASSWORD: password SERIALIZE: 1 - name: Annotate errors From dd89fc110b05403c26f8257ae27521ea23dd198a Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 11:15:56 -0600 Subject: [PATCH 7/9] zookeeper goes with kafka --- .github/workflows/ci.yml | 22 +++++++++++----------- .github/workflows/ci_cron.yml | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6eb72f76c4..0d8f5666fd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -201,17 +201,6 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 10 - zookeeper: - image: bitnami/zookeeper - ports: - - 2181:2181 - env: - ALLOW_ANONYMOUS_LOGIN: yes - options: >- - --health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181" - --health-interval 10s - --health-timeout 5s - --health-retries 5 mongodb: image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} ports: @@ -403,6 +392,17 @@ jobs: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092 + zookeeper: + image: bitnami/zookeeper + ports: + - 2181:2181 + env: + ALLOW_ANONYMOUS_LOGIN: yes + options: >- + --health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181" + --health-interval 10s + --health-timeout 5s + --health-retries 5 strategy: fail-fast: false matrix: diff --git a/.github/workflows/ci_cron.yml b/.github/workflows/ci_cron.yml index a8fb6fde52..fc0d24a070 100644 --- a/.github/workflows/ci_cron.yml +++ b/.github/workflows/ci_cron.yml @@ -193,17 +193,6 @@ jobs: --health-interval 10s --health-timeout 5s --health-retries 10 - zookeeper: - image: bitnami/zookeeper - ports: - - 2181:2181 - env: - ALLOW_ANONYMOUS_LOGIN: yes - options: >- - --health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181" - --health-interval 10s - --health-timeout 5s - --health-retries 5 mongodb: image: ${{ contains(fromJson('["2.4.10"]'), matrix.ruby-version) && 'mongo:5.0.11' || 'mongo:latest' }} ports: @@ -358,6 +347,17 @@ jobs: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092 + zookeeper: + image: bitnami/zookeeper + ports: + - 2181:2181 + env: + ALLOW_ANONYMOUS_LOGIN: yes + options: >- + --health-cmd "echo mntr | nc -w 2 -q 2 localhost 2181" + --health-interval 10s + --health-timeout 5s + --health-retries 5 strategy: fail-fast: false matrix: From 7d69756d4f1f7f4dc1b7382ba1c090f6e26d7614 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 11:25:55 -0600 Subject: [PATCH 8/9] remove sequel so it runs in rest --- test/multiverse/lib/multiverse/runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multiverse/lib/multiverse/runner.rb b/test/multiverse/lib/multiverse/runner.rb index 154ffcab00..42e2dc033b 100644 --- a/test/multiverse/lib/multiverse/runner.rb +++ b/test/multiverse/lib/multiverse/runner.rb @@ -108,7 +108,7 @@ def execute_suites(filter, opts) 'rails' => %w[active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], # these neede services running in github actions, so they are separated - 'services_1' => %w[elasticsearch mongo sequel bunny], + 'services_1' => %w[elasticsearch mongo bunny], 'services_2' => %w[redis sidekiq memcache], 'services_kafka' => %w[rdkafka ruby_kafka], 'services_mysql_pg' => %w[active_record active_record_pg], From 69f118f3e30d1b1cbaea4e90a552c116640cec80 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 14 Jan 2025 11:26:05 -0600 Subject: [PATCH 9/9] spelling --- test/multiverse/lib/multiverse/runner.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/multiverse/lib/multiverse/runner.rb b/test/multiverse/lib/multiverse/runner.rb index 42e2dc033b..0fa2d9c9a9 100644 --- a/test/multiverse/lib/multiverse/runner.rb +++ b/test/multiverse/lib/multiverse/runner.rb @@ -107,7 +107,7 @@ def execute_suites(filter, opts) 'httpclients_2' => %w[typhoeus net_http httprb ethon httpx], 'rails' => %w[active_support_broadcast_logger active_support_logger rails rails_prepend activemerchant], - # these neede services running in github actions, so they are separated + # these need services running in github actions, so they are separated 'services_1' => %w[elasticsearch mongo bunny], 'services_2' => %w[redis sidekiq memcache], 'services_kafka' => %w[rdkafka ruby_kafka],