-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRakefile
45 lines (37 loc) · 1.11 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
# frozen_string_literal: true
require "rake"
require "rake/testtask"
require_relative "test/config"
require_relative "test/support/config"
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/**/*_test.rb"]
t.warning = false
t.verbose = true
end
task default: [:test]
namespace :db do
desc "Build the RedDatabase test databases"
task :build do
config = ARTest.config["default"]
%x( echo "CREATE DATABASE \
'inet4://#{config["host"]}:#{config["port"]}/#{config["database"]}' \
USER '#{config["username"]}' \
PASSWORD '#{config["password"]}' \
PAGE_SIZE #{config["page_size"]} \
DEFAULT CHARACTER SET #{config["charset"]} \
COLLATION #{config["charset"]};" | \
/opt/RedDatabase/bin/isql )
end
desc "Drop the RedDatabase test databases"
task :drop do
config = ARTest.config["default"]
%x( echo 'drop database;' | \
/opt/RedDatabase/bin/isql \
-user '#{config["username"]}' \
-password '#{config["password"]}' \
'inet4://#{config["host"]}:#{config["port"]}/#{config["database"]}' )
end
desc "Rebuild the RedDatabase test databases"
task rebuild: [:drop, :build]
end