Skip to content

Commit

Permalink
Skip benchmark tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom committed Mar 6, 2024
1 parent 64034c0 commit 392d04f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/extract_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/test_runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion tests/benchmarks/two_fer_benchmark_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 392d04f

Please sign in to comment.