Repository navigation
Expand file tree
/
Copy pathRakefile
More file actions
executable file
·63 lines (49 loc) · 1.64 KB
/
Copy pathRakefile
File metadata and controls
executable file
·63 lines (49 loc) · 1.64 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env ruby
require 'rake'
require 'rake/testtask'
# Plugin unit + golden tests (pure Ruby, no databases needed).
Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/*_test.rb'
end
Rake::TestTask.new(:end2end_tests) do |t| # called inside Docker
t.pattern = 'tests/end2end_*.rb'
end
# one database at a time (CI runs them as separate jobs against service containers)
%w[pg mysql2 sqlite3].each do |driver|
Rake::TestTask.new("end2end_#{driver}") do |t|
t.description = "End-to-end tests of the #{driver} examples against a real database"
t.pattern = "tests/end2end_#{driver}.rb"
end
end
task :rubocop do
sh 'bundle exec rubocop examples'
end
task :steep do
sh 'bundle exec steep check --with-expectations'
end
task :run_end2end_tests do
sh './scripts/tests/run_end2end.sh'
end
task :run_tests => [:run_end2end_tests]
# --- Process plugin (exe/plugin.rb run directly by sqlc) ---
task :sqlc_generate_process do
sh 'sqlc -f sqlc.local.yaml generate'
end
task :test_process_plugin => [:test, :sqlc_generate_process, :run_tests]
# --- WASM plugin (dist/plugin.wasm: ruby.wasm interpreter + this plugin, see scripts/wasm/build.sh) ---
task :wasm_build do
sh './scripts/wasm/build.sh'
end
task :update_wasm_plugin do
sh './scripts/wasm/update_sha.sh sqlc.ci.yaml'
end
# regenerates docs/Examples.md from sqlc.ci.yaml
task :docs do
sh 'ruby scripts/docs/generate_examples.rb docs/Examples.md'
end
task :sqlc_generate_wasm => [:wasm_build, :update_wasm_plugin] do
ENV['SQLCCACHE'] = './'
sh 'sqlc -f sqlc.ci.yaml generate'
end
task :test_wasm_plugin => [:test, :sqlc_generate_wasm, :update_wasm_plugin, :run_tests]