forked from raviqqe/muffet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrakefile.rb
44 lines (34 loc) · 1.14 KB
/
rakefile.rb
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
task :deps do
sh 'go get -u github.com/alecthomas/gometalinter'
sh 'gometalinter --install'
sh 'go get -d -t ./...'
end
task :lint do
sh 'gometalinter --disable gocyclo --disable vetshadow ./...'
end
task :build do
sh 'go build'
end
task :unit_test do
sh 'go test -covermode atomic -coverprofile coverage.txt'
end
task integration_test: :build do
sh './muffet http://localhost:8080'
sh '! ./muffet http://localhost:8888'
sh './muffet -c 1 http://localhost:8080'
sh './muffet --concurrency 1 http://localhost:8080'
sh './muffet --help'
sh './muffet -v http://localhost:8080 | grep OK'
sh '[ $(./muffet -v http://localhost:8080 | wc -l) -eq 14 ]'
sh './muffet --verbose http://localhost:8080 | grep OK'
sh '! ./muffet http://localhost:8080 | grep OK'
sh './muffet -v http://localhost:8080 | sort > /tmp/muffet_1.txt'
sh './muffet -v http://localhost:8080 | sort > /tmp/muffet_2.txt'
sh 'diff /tmp/muffet_1.txt /tmp/muffet_2.txt'
sh '! ./muffet http://localhost:8080 | grep .'
end
task :serve do
[['test/valid', 8080], ['test/dead_link', 8888]].each do |args|
sh "ruby -run -e httpd #{args[0]} -p #{args[1]} &"
end
end