From 392d04fc24f291421de9e74f728e8670eca36fab Mon Sep 17 00:00:00 2001 From: Erik Schierboom Date: Wed, 6 Mar 2024 08:56:48 +0100 Subject: [PATCH] Skip benchmark tests --- lib/extract_metadata.rb | 2 +- lib/test_runner.rb | 2 ++ tests/benchmarks/two_fer_benchmark_test.rb | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/extract_metadata.rb b/lib/extract_metadata.rb index 3567202..67c1d8e 100644 --- a/lib/extract_metadata.rb +++ b/lib/extract_metadata.rb @@ -30,7 +30,7 @@ def call end def on_def(node) - return unless node.method_name.to_s.start_with?("test_", "bench_") + return unless node.method_name.to_s.start_with?("test_") tests << ExtractTestMetadata.(filelines, node, @num_tests) @num_tests += 1 diff --git a/lib/test_runner.rb b/lib/test_runner.rb index 4d6441e..953329f 100644 --- a/lib/test_runner.rb +++ b/lib/test_runner.rb @@ -39,6 +39,8 @@ def run Minitest::PrideIO.pride! Dir.glob(File.join(input_path, "*_test.rb")).sort.each do |test_file| + next if test_file.end_with?("_benchmark_test.rb") + reporter.set_metadata(test_file, ExtractMetadata.(test_file)) begin diff --git a/tests/benchmarks/two_fer_benchmark_test.rb b/tests/benchmarks/two_fer_benchmark_test.rb index d98b04b..1900f81 100644 --- a/tests/benchmarks/two_fer_benchmark_test.rb +++ b/tests/benchmarks/two_fer_benchmark_test.rb @@ -4,7 +4,6 @@ class TwoFerBenchmarkTest < Minitest::Benchmark def bench_two_fer - skip assert_performance_linear 0.9999 do |n| # n is a range value TwoFer.two_fer end