-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRakefile
More file actions
70 lines (58 loc) · 1.7 KB
/
Copy pathRakefile
File metadata and controls
70 lines (58 loc) · 1.7 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
64
65
66
67
68
69
70
# frozen_string_literal: true
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.pattern = "test/**/*_test.rb"
end
namespace :test do
Rake::TestTask.new(:all) do |t|
t.libs << "test"
t.libs << "lib"
t.pattern = "test/**/*_test.rb"
end
Rake::TestTask.new(:unit) do |t|
t.libs << "test"
t.libs << "lib"
t.pattern = "test/unit/**/*_test.rb"
end
# Highest-risk pages only (~2 min): selection grounded in git churn
# (2026-07-19 analysis: blog + homepage + course + site-wide dominate
# 6-month history) + the lead-gen funnel (services, contact,
# free-consultation). Full system suite = test:system; everything = test:all.
CRITICAL_TESTS =
"/homepage|blog_index|blog_post$|visit_blog_post|course_|old_blog_url|" \
"test_services($|_menu)|contact_us|free_consultation|not_found|" \
"hamburger|color_system|mermaid|codeblock_language/"
Rake::TestTask.new(:critical) do |t|
t.libs << "test"
t.libs << "lib"
t.pattern = "test/system/*_test.rb"
t.options = "--name='#{CRITICAL_TESTS}'"
end
Rake::TestTask.new(:system) do |t|
t.libs << "test"
t.libs << "lib"
t.pattern = "test/system/**/*_test.rb"
end
Rake::TestTask.new(:integration) do |t|
t.libs << "test"
t.libs << "lib"
t.pattern = "test/integration/**/*_test.rb"
end
end
desc "Build the site (Hugo)"
task :build do
sh "./bin/hugo-build"
end
desc "Run server (Hugo)"
task :dev do
sh "./bin/hugo-dev"
end
desc "Crawl site and run Lighthouse on each page (bin/lighthouse)"
task :lighthouse, [:limit] do |_t, args|
cmd = "./bin/lighthouse"
cmd += " --limit #{args[:limit]}" if args[:limit]
sh cmd
end
task default: "test:all"