-
Notifications
You must be signed in to change notification settings - Fork 11
/
Rakefile
47 lines (37 loc) · 1.21 KB
/
Rakefile
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
35
36
37
38
39
40
41
42
43
44
45
46
47
# SPDX-License-Identifier: Apache-2.0
#
# The OpenSearch Contributors require contributions made to
# this file be licensed under the Apache-2.0 license or a
# compatible open source license.
#
# Modifications Copyright OpenSearch Contributors. See
# GitHub history for details.
# frozen_string_literal: true
require 'bundler/gem_tasks'
task(:default) { system 'rake --tasks' }
desc 'Run unit tests'
task test: 'test:spec'
# ----- Test tasks ------------------------------------------------------------
require 'rspec/core/rake_task'
namespace :test do
RSpec::Core::RakeTask.new(:integration) do |t|
t.pattern = 'spec/integration/**{,/*/**}/*_spec.rb'
end
RSpec::Core::RakeTask.new(:unit) do |t|
t.pattern = 'spec/unit/**{,/*/**}/*_spec.rb'
end
desc 'Run unit and integration tests'
task :all do
Rake::Task['test:unit'].invoke
Rake::Task['test:integration'].invoke
end
end
# ----- Documentation tasks ---------------------------------------------------
desc 'Generate documentation for preview'
task :gh_pages do
yard_cmd = 'yard doc --embed-mixins --markup=rdoc --output-dir docs ./docs lib/**/*.rb'
Kernel.system yard_cmd
%w[OpenSearch.svg].each do |file|
cp file, './docs'
end
end