File: Rakefile

package info (click to toggle)
ruby-redis 5.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,160 kB
  • sloc: ruby: 11,445; makefile: 117; sh: 24
file content (34 lines) | stat: -rw-r--r-- 1,048 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# frozen_string_literal: true

require 'bundler/gem_tasks'
Bundler::GemHelper.install_tasks(dir: "cluster", name: "redis-clustering")

require 'rake/testtask'

namespace :test do
  groups = %i(redis distributed sentinel)
  groups.each do |group|
    Rake::TestTask.new(group) do |t|
      t.libs << "test"
      t.libs << "lib"
      t.test_files = FileList["test/#{group}/**/*_test.rb"] - FileList["test/#{group}/**/*ssl_test.rb"]
      t.options = '-v' if ENV['CI'] || ENV['VERBOSE']
    end
  end

  lost_tests = Dir["test/**/*_test.rb"] - groups.map { |g| Dir["test/#{g}/**/*_test.rb"] }.flatten
  unless lost_tests.empty?
    abort "The following test files are in no group:\n#{lost_tests.join("\n")}"
  end

  Rake::TestTask.new(:cluster) do |t|
    t.libs << "cluster/test" << "test"
    t.libs << "cluster/lib" << "lib"
    t.test_files = FileList["cluster/test/**/*_test.rb"]
    t.options = '-v' if ENV['CI'] || ENV['VERBOSE']
  end
end

task test: ["test:redis", "test:distributed", "test:sentinel", "test:cluster"]

task default: :test