From 37d8ce84744dc60f85f8a1584a2bdec090ed5324 Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Sat, 28 Feb 2026 02:51:52 +0100 Subject: [PATCH] Ruby: Add more granular test rake tasks --- .github/workflows/build.yml | 2 +- Rakefile | 28 +++++++++++++++++++ bin/test | 2 +- bin/test_debug | 2 +- ext/project.json | 2 +- .../{engine => integration}/cli_stdin_test.rb | 0 test/{engine => integration}/cli_test.rb | 0 7 files changed, 32 insertions(+), 4 deletions(-) rename test/{engine => integration}/cli_stdin_test.rb (100%) rename test/{engine => integration}/cli_test.rb (100%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 14f15c7cb..307ffd462 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -75,7 +75,7 @@ jobs: run: bundle exec rake compile - name: Run Ruby Tests - run: bundle exec rake test + run: bundle exec rake test:all - name: Run C tests run: ./run_herb_tests diff --git a/Rakefile b/Rakefile index 21daa5347..57b577468 100644 --- a/Rakefile +++ b/Rakefile @@ -5,6 +5,34 @@ require "bundler/gem_tasks" require "rake/testtask" Rake::TestTask.new(:test) do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/**/*_test.rb"].exclude("test/engine/**/*_test.rb", "test/integration/**/*_test.rb") +end + +task :test_tip do + puts "TIP: This only runs core tests. Other test tasks available:" + puts " rake test:all" + puts " rake test:engine" + puts " rake test:integration" + puts +end + +Rake::Task[:test].enhance([:test_tip]) + +Rake::TestTask.new("test:engine") do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/engine/**/*_test.rb"] +end + +Rake::TestTask.new("test:integration") do |t| + t.libs << "test" + t.libs << "lib" + t.test_files = FileList["test/integration/**/*_test.rb"] +end + +Rake::TestTask.new("test:all") do |t| t.libs << "test" t.libs << "lib" t.test_files = FileList["test/**/*_test.rb"] diff --git a/bin/test b/bin/test index 883e6af9f..25b5281cf 100755 --- a/bin/test +++ b/bin/test @@ -4,6 +4,6 @@ set -e # Exit on error make all ./run_herb_tests -bundle exec rake test +bundle exec rake test:all echo "Tests successful!" diff --git a/bin/test_debug b/bin/test_debug index f1dda8166..32913452f 100755 --- a/bin/test_debug +++ b/bin/test_debug @@ -4,6 +4,6 @@ set -e # Exit on error make all ./run_herb_tests -FORK_TESTS=true bundle exec rake test +FORK_TESTS=true bundle exec rake test:all echo "Tests successful!" diff --git a/ext/project.json b/ext/project.json index f28b07b9e..f3dd3e26d 100644 --- a/ext/project.json +++ b/ext/project.json @@ -21,7 +21,7 @@ "test": { "executor": "nx:run-commands", "options": { - "command": "bundle exec rake test" + "command": "bundle exec rake test:all" }, "dependsOn": ["ruby-gem:build"] } diff --git a/test/engine/cli_stdin_test.rb b/test/integration/cli_stdin_test.rb similarity index 100% rename from test/engine/cli_stdin_test.rb rename to test/integration/cli_stdin_test.rb diff --git a/test/engine/cli_test.rb b/test/integration/cli_test.rb similarity index 100% rename from test/engine/cli_test.rb rename to test/integration/cli_test.rb