wackamole 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -0
- data/bin/setup_indexes +44 -0
- data/bin/wackamole +8 -6
- data/config.ru +18 -0
- data/lib/app.rb +8 -5
- data/lib/controllers/dashboard.rb +13 -1
- data/lib/controllers/features.rb +4 -0
- data/lib/controllers/logs.rb +14 -5
- data/lib/controllers/mission.rb +19 -12
- data/lib/controllers/users.rb +7 -0
- data/lib/helpers/dashboard_helper.rb +7 -7
- data/lib/helpers/logs_helper.rb +29 -12
- data/lib/helpers/mission_helper.rb +21 -7
- data/lib/wackamole.rb +1 -1
- data/lib/wackamole/models/control.rb +45 -22
- data/lib/wackamole/models/log.rb +6 -4
- data/lib/wackamole/models/mission.rb +44 -132
- data/lib/wackamole/models/mole_info.rb +21 -15
- data/lib/wackamole/models/search_filter.rb +25 -11
- data/public/images/browsers_sprite.png +0 -0
- data/public/images/fault_small.png +0 -0
- data/public/images/perf_small.png +0 -0
- data/public/stylesheets/wackamole.css +135 -111
- data/spec/models/log_spec.rb +4 -4
- data/spec/models/mission_spec.rb +13 -192
- data/spec/models/search_filter_spec.rb +37 -9
- data/views/dashboard/_report.erb +2 -2
- data/views/dashboard/index.erb +2 -0
- data/views/features/index.erb +3 -1
- data/views/layout.erb +7 -7
- data/views/logs/_rows.erb +4 -3
- data/views/logs/index.erb +3 -1
- data/views/logs/show.erb +4 -8
- data/views/mission/_report.erb +66 -40
- data/views/mission/index.erb +1 -3
- data/views/mission/refresh_js.erb +5 -2
- data/views/mission/trash.txt +50 -0
- data/views/shared/_filter.erb +8 -9
- data/views/shared/_search.erb +2 -2
- data/views/users/index.erb +3 -1
- metadata +18 -2
Binary file
|
Binary file
|
Binary file
|
@@ -39,16 +39,28 @@ div#main {
|
|
39
39
|
overflow: none;
|
40
40
|
}
|
41
41
|
|
42
|
+
div.corners {
|
43
|
+
-moz-border-radius: 10px;
|
44
|
+
-webkit-border-radius: 10px;
|
45
|
+
}
|
46
|
+
|
47
|
+
div.spe_corners {
|
48
|
+
-moz-border-radius-topleft: 7px;
|
49
|
+
-moz-border-radius-topright: 7px;
|
50
|
+
-moz-border-radius-bottomleft: 7px;
|
51
|
+
-moz-border-radius-bottomright: 0px;
|
52
|
+
-webkit-border-top-left-radius: 7px;
|
53
|
+
-webkit-border-top-right-radius: 7px;
|
54
|
+
-webkit-border-bottom-left-radius: 7px;
|
55
|
+
-webkit-border-bottom-right-radius: 0px;
|
56
|
+
}
|
57
|
+
|
42
58
|
div#navigation {
|
43
|
-
margin:
|
44
|
-
padding:
|
45
|
-
font-size:
|
46
|
-
text-align:
|
47
|
-
background:
|
48
|
-
-moz-border-radius-bottomleft: 2px;
|
49
|
-
-moz-border-radius-topleft: 2px;
|
50
|
-
-moz-border-radius-bottomright: 2px;
|
51
|
-
-moz-border-radius-topright: 2px;
|
59
|
+
margin: 10px 0px 20px 0px;
|
60
|
+
padding: 5px 0px 5px 0px;
|
61
|
+
font-size: 1.5em;
|
62
|
+
text-align: center;
|
63
|
+
background: #c1c1c1 url(../images/fade.png) repeat-x;
|
52
64
|
}
|
53
65
|
|
54
66
|
a.site_link {
|
@@ -70,7 +82,13 @@ a.current {
|
|
70
82
|
|
71
83
|
div#app_info {
|
72
84
|
text-align: right;
|
73
|
-
font-size:
|
85
|
+
font-size: 2em;
|
86
|
+
}
|
87
|
+
div#app_info li {
|
88
|
+
color:#3968ff;
|
89
|
+
}
|
90
|
+
div#app_info li span {
|
91
|
+
color:#666;
|
74
92
|
}
|
75
93
|
div#app_info li#env {
|
76
94
|
color: #c1c1c1;
|
@@ -78,8 +96,10 @@ div#app_info li#env {
|
|
78
96
|
font-style: italic;
|
79
97
|
}
|
80
98
|
div#app_info p {
|
81
|
-
text-align: right;
|
82
|
-
font-size:
|
99
|
+
text-align: right;
|
100
|
+
font-size: 1.0em;
|
101
|
+
}
|
102
|
+
span#timestamp {
|
83
103
|
}
|
84
104
|
|
85
105
|
#header {
|
@@ -87,9 +107,9 @@ div#app_info p {
|
|
87
107
|
}
|
88
108
|
|
89
109
|
p {
|
90
|
-
font-size: 2em;
|
110
|
+
font-size: 1.2em;
|
91
111
|
text-align: left;
|
92
|
-
color
|
112
|
+
color: #666;
|
93
113
|
}
|
94
114
|
|
95
115
|
.img {
|
@@ -181,10 +201,6 @@ div#filters {
|
|
181
201
|
border: 1px #242424 solid;
|
182
202
|
background: #242424 url(../images/fade.png) repeat-x;
|
183
203
|
padding: 5px 10px 10px 10px;
|
184
|
-
-moz-border-radius-topleft: 7px;
|
185
|
-
-moz-border-radius-topright: 7px;
|
186
|
-
-moz-border-radius-bottomleft: 7px;
|
187
|
-
-moz-border-radius-bottomright: 7px;
|
188
204
|
margin-bottom: 10px;
|
189
205
|
overflow: auto;
|
190
206
|
}
|
@@ -194,25 +210,29 @@ div#filters {
|
|
194
210
|
div.ov_content {
|
195
211
|
text-align: left;
|
196
212
|
}
|
197
|
-
p#info
|
198
|
-
|
199
|
-
|
213
|
+
p#info {
|
214
|
+
margin: 10px 0px 10px 20px;
|
215
|
+
float: left;
|
200
216
|
}
|
201
|
-
|
217
|
+
img.info {
|
218
|
+
float: left;
|
219
|
+
margin-right: 10px;
|
220
|
+
}
|
221
|
+
p#info span#type {
|
202
222
|
font-size: 2em;
|
203
223
|
text-align: left;
|
204
|
-
|
224
|
+
color: #c1c1c1;
|
205
225
|
}
|
206
|
-
p#info
|
226
|
+
p#info span#feature {
|
207
227
|
clear: left;
|
208
228
|
font-size: 2em;
|
209
229
|
text-align: left;
|
210
|
-
|
230
|
+
color: #666;
|
211
231
|
}
|
212
232
|
div#info {
|
213
233
|
clear: left;
|
214
234
|
text-align: left;
|
215
|
-
margin:
|
235
|
+
margin: 10px 10px 30px 10px;
|
216
236
|
}
|
217
237
|
|
218
238
|
/* ------------------------------------------------------------------------- */
|
@@ -221,10 +241,6 @@ div#logs {
|
|
221
241
|
border: 1px #242424 solid;
|
222
242
|
background: #c1c1c1 url(../images/fade.png) repeat-x;
|
223
243
|
padding: 0px 10px 10px 10px;
|
224
|
-
-moz-border-radius-topleft: 7px;
|
225
|
-
-moz-border-radius-topright: 7px;
|
226
|
-
-moz-border-radius-bottomleft: 7px;
|
227
|
-
-moz-border-radius-bottomright: 0px;
|
228
244
|
margin-bottom: 10px;
|
229
245
|
clear: left;
|
230
246
|
}
|
@@ -233,10 +249,6 @@ div#users {
|
|
233
249
|
border: 1px #242424 solid;
|
234
250
|
background: #c1c1c1 url(../images/fade.png) repeat-x;
|
235
251
|
padding: 0px 10px 10px 10px;
|
236
|
-
-moz-border-radius-topleft: 7px;
|
237
|
-
-moz-border-radius-topright: 7px;
|
238
|
-
-moz-border-radius-bottomleft: 7px;
|
239
|
-
-moz-border-radius-bottomright: 0px;
|
240
252
|
margin-bottom: 10px;
|
241
253
|
}
|
242
254
|
|
@@ -244,19 +256,15 @@ div#features {
|
|
244
256
|
border: 1px #242424 solid;
|
245
257
|
background: #c1c1c1 url(../images/fade.png) repeat-x;
|
246
258
|
padding: 0px 10px 10px 10px;
|
247
|
-
-moz-border-radius-topleft: 7px;
|
248
|
-
-moz-border-radius-topright: 7px;
|
249
|
-
-moz-border-radius-bottomleft: 7px;
|
250
|
-
-moz-border-radius-bottomright: 0px;
|
251
259
|
margin-bottom: 10px;
|
252
260
|
}
|
253
261
|
|
254
262
|
|
255
263
|
/* Titles */
|
256
264
|
p.title {
|
257
|
-
font-size:
|
265
|
+
font-size: 1.5em;
|
258
266
|
text-align: left;
|
259
|
-
color: #
|
267
|
+
color: #808080;
|
260
268
|
font-weight: bold;
|
261
269
|
}
|
262
270
|
|
@@ -277,24 +285,28 @@ a.fault {
|
|
277
285
|
font-variant: small-caps;
|
278
286
|
}
|
279
287
|
|
280
|
-
/*
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
-moz-border-radius-bottomright: 7px;
|
287
|
-
border: 1px solid #434343;
|
288
|
-
margin: 10px;
|
288
|
+
/* ------------------------------------------------------------------------- */
|
289
|
+
/* Flash */
|
290
|
+
|
291
|
+
div.flash {
|
292
|
+
display: none;
|
293
|
+
width: 95%;
|
289
294
|
padding: 10px;
|
290
295
|
font-size: 1.5em;
|
296
|
+
color: #fff;
|
297
|
+
border: 1px #92b948 solid;
|
298
|
+
-moz-border-radius-bottomleft: 20px;
|
299
|
+
-moz-border-radius-topleft: 0px;
|
300
|
+
-moz-border-radius-bottomright: 0px;
|
301
|
+
-moz-border-radius-topright: 20px;
|
291
302
|
}
|
292
|
-
|
293
|
-
|
294
|
-
|
303
|
+
div.flash_error {
|
304
|
+
color: #f00;
|
305
|
+
border: 1px #f00 solid;
|
295
306
|
}
|
296
|
-
div
|
297
|
-
color:
|
307
|
+
div.flash_info {
|
308
|
+
color: #fff;
|
309
|
+
border: 1px #92b948 solid;
|
298
310
|
}
|
299
311
|
|
300
312
|
/* ------------------------------------------------------------------------- */
|
@@ -382,38 +394,13 @@ table.moled tr td {
|
|
382
394
|
padding: 2px 10px;
|
383
395
|
}
|
384
396
|
|
385
|
-
/* Flash */
|
386
|
-
div.flash {
|
387
|
-
display: none;
|
388
|
-
width: 95%;
|
389
|
-
padding: 10px;
|
390
|
-
margin: 20px 0 0px 300px;
|
391
|
-
font-size: .5em;
|
392
|
-
color: #fff;
|
393
|
-
border: 1px #92b948 solid;
|
394
|
-
-moz-border-radius-bottomleft: 20px;
|
395
|
-
-moz-border-radius-topleft: 0px;
|
396
|
-
-moz-border-radius-bottomright: 0px;
|
397
|
-
-moz-border-radius-topright: 20px;
|
398
|
-
}
|
399
|
-
div.flash_error {
|
400
|
-
color: #f00;
|
401
|
-
border: 1px #f00 solid;
|
402
|
-
}
|
403
|
-
div.flash_info {
|
404
|
-
color: #fff;
|
405
|
-
border: 1px #92b948 solid;
|
406
|
-
}
|
407
|
-
|
408
397
|
/* ------------------------------------------------------------------------- */
|
409
398
|
/* Overlay */
|
410
399
|
.overlay {
|
411
400
|
display: none;
|
412
401
|
z-index: 10000;
|
413
|
-
-moz-border-radius
|
414
|
-
-
|
415
|
-
-moz-border-radius-bottomleft: 10px;
|
416
|
-
-moz-border-radius-bottomright: 10px;
|
402
|
+
-moz-border-radius: 10px;
|
403
|
+
-webkit-border-radius: 10px;
|
417
404
|
background-color: #fff;
|
418
405
|
width: 650px;
|
419
406
|
min-height: 200px;
|
@@ -442,8 +429,8 @@ div.flash_info {
|
|
442
429
|
float: left;
|
443
430
|
}
|
444
431
|
img#search_loader {
|
445
|
-
|
446
|
-
display:
|
432
|
+
vertical-align: sub;
|
433
|
+
display: none;
|
447
434
|
}
|
448
435
|
|
449
436
|
#filter_form {
|
@@ -454,7 +441,7 @@ img#search_loader {
|
|
454
441
|
}
|
455
442
|
fieldset#submit {
|
456
443
|
float: left;
|
457
|
-
margin
|
444
|
+
margin: 0 10px 0 10px;
|
458
445
|
min-width: 0px;
|
459
446
|
}
|
460
447
|
fieldset#submit input {
|
@@ -488,10 +475,14 @@ input.search {
|
|
488
475
|
height: 17px;
|
489
476
|
padding: 0px 0px 0px 20px;
|
490
477
|
margin: 10px 0px 0px 0px;
|
491
|
-
-moz-border-radius-topleft:
|
492
|
-
-moz-border-radius-topright:
|
493
|
-
-moz-border-radius-bottomleft:
|
494
|
-
-moz-border-radius-bottomright:
|
478
|
+
-moz-border-radius-topleft: 7px;
|
479
|
+
-moz-border-radius-topright: 7px;
|
480
|
+
-moz-border-radius-bottomleft: 7px;
|
481
|
+
-moz-border-radius-bottomright: 0px;
|
482
|
+
-webkit-border-top-left-radius: 7px;
|
483
|
+
-webkit-border-top-right-radius: 7px;
|
484
|
+
-webkit-border-bottom-left-radius: 7px;
|
485
|
+
-webkit-border-bottom-right-radius: 0px;
|
495
486
|
}
|
496
487
|
|
497
488
|
.example {
|
@@ -528,24 +519,23 @@ ul.section li {
|
|
528
519
|
-moz-border-radius-bottomleft: 7px;
|
529
520
|
-moz-border-radius-bottomright: 0px;
|
530
521
|
margin: 10px;
|
522
|
+
min-height: 65px;
|
531
523
|
}
|
532
524
|
|
533
525
|
ul.section li p {
|
534
526
|
color: #646464;
|
535
|
-
padding:
|
527
|
+
padding: 5px 0px 5px 30px;
|
536
528
|
text-align: left;
|
537
|
-
|
529
|
+
float: left;
|
530
|
+
width: 10%;
|
538
531
|
}
|
539
532
|
ul.section li p.no_report {
|
540
533
|
text-align: center;
|
541
|
-
}
|
542
|
-
|
543
|
-
p.no_report {
|
544
534
|
font-size: 1.2em;
|
545
535
|
color: #434343;
|
536
|
+
width: 70%;
|
546
537
|
}
|
547
538
|
|
548
|
-
|
549
539
|
ul#summary li {
|
550
540
|
border: none;
|
551
541
|
border-top: 1px #c1c1c1 solid;
|
@@ -621,7 +611,6 @@ p.app_name {
|
|
621
611
|
p.perf {
|
622
612
|
color: #0000ff;
|
623
613
|
}
|
624
|
-
|
625
614
|
p.fault {
|
626
615
|
color: #ff0000;
|
627
616
|
}
|
@@ -642,8 +631,7 @@ div.environment {
|
|
642
631
|
-moz-border-radius-topleft: 7px;
|
643
632
|
-moz-border-radius-topright: 7px;
|
644
633
|
-moz-border-radius-bottomleft: 7px;
|
645
|
-
-moz-border-radius-bottomright: 7px;
|
646
|
-
|
634
|
+
-moz-border-radius-bottomright: 7px;
|
647
635
|
}
|
648
636
|
|
649
637
|
div.env {
|
@@ -659,26 +647,62 @@ div.details {
|
|
659
647
|
text-align: right;
|
660
648
|
}
|
661
649
|
|
662
|
-
|
663
|
-
color:
|
664
|
-
background:
|
665
|
-
}
|
666
|
-
|
667
|
-
td.perf {
|
668
|
-
color: white;
|
669
|
-
background: blue;
|
650
|
+
span.last_tick_fault {
|
651
|
+
color: #fff;
|
652
|
+
background: #ff321d;
|
670
653
|
}
|
671
|
-
|
672
|
-
|
673
|
-
background:
|
654
|
+
span.last_tick_perf {
|
655
|
+
color: #fff;
|
656
|
+
background: #368bff;
|
674
657
|
}
|
675
|
-
|
676
|
-
td.inactive {
|
658
|
+
span.last_tick_feature {
|
677
659
|
color: #fff;
|
678
|
-
background: #
|
660
|
+
background: #86ff36;
|
661
|
+
}
|
662
|
+
span.today_fault {
|
663
|
+
color: #ff321d;
|
664
|
+
}
|
665
|
+
span.today_perf {
|
666
|
+
color: #368bff;
|
667
|
+
}
|
668
|
+
span.today_feature {
|
669
|
+
color: #87b76c;
|
679
670
|
}
|
680
671
|
|
672
|
+
|
681
673
|
a.fixed {
|
682
674
|
color: orange;
|
683
675
|
text-decoration: none;
|
676
|
+
}
|
677
|
+
|
678
|
+
/* ------------------------------------------------------------------------- */
|
679
|
+
/* Browsers */
|
680
|
+
div.browser {
|
681
|
+
width: 21px;
|
682
|
+
height: 20px;
|
683
|
+
background: transparent url("../images/browsers_sprite.png" ) no-repeat top left;
|
684
|
+
}
|
685
|
+
div.safari {
|
686
|
+
background-position: 0 0;
|
687
|
+
}
|
688
|
+
div.firefox {
|
689
|
+
background-position: -21px 0;
|
690
|
+
}
|
691
|
+
div.chrome {
|
692
|
+
background-position: -42px 0;
|
693
|
+
}
|
694
|
+
div.opera {
|
695
|
+
background-position: -64px 0;
|
696
|
+
}
|
697
|
+
div.ie_6 {
|
698
|
+
background-position: -88px 0;
|
699
|
+
}
|
700
|
+
div.ie_7 {
|
701
|
+
background-position: -110px 0;
|
702
|
+
}
|
703
|
+
div.ie_8 {
|
704
|
+
background-position: -132px 0;
|
705
|
+
}
|
706
|
+
div.unknown {
|
707
|
+
background-position: -154px 0;
|
684
708
|
}
|
data/spec/models/log_spec.rb
CHANGED
@@ -26,18 +26,18 @@ describe Wackamole::Log do
|
|
26
26
|
indexes = @cltn.index_information
|
27
27
|
indexes.should have(1).item
|
28
28
|
count = Wackamole::Log.ensure_indexes!
|
29
|
-
count.should ==
|
29
|
+
count.should == 2
|
30
30
|
indexes = @cltn.index_information
|
31
|
-
indexes.should have(
|
31
|
+
indexes.should have(5).items
|
32
32
|
end
|
33
33
|
|
34
34
|
it "should do nothing if indexes are already present" do
|
35
35
|
indexes = @cltn.index_information
|
36
|
-
indexes.should have(
|
36
|
+
indexes.should have(5).items
|
37
37
|
count = Wackamole::Log.ensure_indexes!
|
38
38
|
count.should == 0
|
39
39
|
indexes = @cltn.index_information
|
40
|
-
indexes.should have(
|
40
|
+
indexes.should have(5).items
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
data/spec/models/mission_spec.rb
CHANGED
@@ -24,202 +24,23 @@ describe Wackamole::Mission do
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
it "should rollup statuses for a time correctly" do
|
40
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
41
|
-
rollups.should have(1).item
|
42
|
-
rollup = rollups.first
|
43
|
-
rollup['envs'].should have(3).items
|
44
|
-
envs = %w[development production test]
|
45
|
-
rollup['app'].should == 'fred'
|
46
|
-
rollup['envs'].each_pair do |env, info|
|
47
|
-
envs.include?( env ).should == true
|
48
|
-
envs = envs - [env]
|
49
|
-
info.keys.sort.should == %w[faults features perfs]
|
50
|
-
info.values.should == [2, 2, 2]
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
it "should rollup statuses for the day correctly" do
|
55
|
-
rollups = Wackamole::Mission.rollups( @test_time, true )
|
56
|
-
rollups.should have(1).item
|
57
|
-
rollup = rollups.first
|
58
|
-
rollup['envs'].should have(3).items
|
59
|
-
envs = %w[development production test]
|
60
|
-
rollup['app'].should == 'fred'
|
61
|
-
rollup['envs'].each_pair do |env, info|
|
62
|
-
envs.include?( env ).should == true
|
63
|
-
envs = envs - [env]
|
64
|
-
info.keys.sort.should == %w[faults features perfs]
|
65
|
-
info.values.should == [7, 7, 7]
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
it "should update a rollup correctly" do
|
70
|
-
Wackamole::Mission.rollups( @test_time, false )
|
71
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
72
|
-
rollups.should have(1).item
|
73
|
-
rollup = rollups.first
|
74
|
-
rollup['envs'].should have(3).items
|
75
|
-
envs = %w[development production test]
|
76
|
-
rollup['app'].should == 'fred'
|
77
|
-
rollup['envs'].each_pair do |env, info|
|
78
|
-
envs.include?( env ).should == true
|
79
|
-
envs = envs - [env]
|
80
|
-
info.keys.sort.should == %w[faults features perfs]
|
81
|
-
info.values.should == [4, 4, 4]
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
describe "#reset!" do
|
86
|
-
it "should clear out a mole correctly" do
|
87
|
-
Fixtures.create_valid_mole_db( @con, 'blee', "test" )
|
88
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
89
|
-
rollup = Wackamole::Mission.rollups_cltn.find_one( { :app => 'blee' } )
|
90
|
-
rollup.should_not be_nil
|
91
|
-
%w[features perfs faults].each do |type|
|
92
|
-
rollup['envs']['test'][type].should == 2
|
93
|
-
end
|
94
|
-
Wackamole::Mission.reset!( 'blee', 'test', 'faults' )
|
95
|
-
rollup = Wackamole::Mission.rollups_cltn.find_one( { :app => 'blee' } )
|
96
|
-
rollup['envs']['test']['faults'].should == 0
|
97
|
-
%w[features perfs].each do |type|
|
98
|
-
rollup['envs']['test'][type].should == 2
|
99
|
-
end
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
describe '#clean!' do
|
104
|
-
before( :each ) do
|
105
|
-
@con.drop_database( "mole_blee_test_mdb" )
|
106
|
-
@con.drop_database( "mole_blee_development_mdb" )
|
107
|
-
end
|
108
|
-
|
109
|
-
it "should update the rollups if an env is no longer in the db" do
|
110
|
-
Fixtures.create_valid_mole_db( @con, 'blee', "test" )
|
111
|
-
Fixtures.create_valid_mole_db( @con, 'blee', "development" )
|
112
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
113
|
-
rollups.should have(2).items
|
114
|
-
@con.drop_database( "mole_blee_test_mdb" )
|
115
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
116
|
-
rollups.should have(2).items
|
117
|
-
rollup = Wackamole::Mission.rollups_cltn.find_one( { :app => 'blee' } )
|
118
|
-
rollup.should_not be_nil
|
119
|
-
rollup['envs'].should have(1).item
|
120
|
-
end
|
121
|
-
|
122
|
-
it "should remove a rollup if an app is no longer in the db" do
|
123
|
-
Fixtures.create_valid_mole_db( @con, 'blee', "test" )
|
124
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
125
|
-
rollups.should have(2).items
|
126
|
-
@con.drop_database( "mole_blee_test_mdb" )
|
127
|
-
rollups = Wackamole::Mission.rollups( @test_time, false )
|
128
|
-
rollups.should have(1).items
|
129
|
-
end
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
describe "#comp_applications" do
|
134
|
-
it "should gather report for a given day correctly" do
|
135
|
-
report = Wackamole::Mission.comb_applications( @test_time, true )
|
136
|
-
report.should have(1).item
|
137
|
-
report['fred'].should_not be_nil
|
138
|
-
report['fred']['envs'].should have(3).items
|
139
|
-
|
140
|
-
envs = %w[development production test]
|
141
|
-
expected = { 0 => 7, 1 => 7, 2 => 7}
|
142
|
-
report['fred']['envs'].each_pair do |env, info|
|
143
|
-
envs.include?( env ).should == true
|
144
|
-
envs = envs - [env]
|
145
|
-
info.should == expected
|
146
|
-
end
|
147
|
-
end
|
148
|
-
|
149
|
-
it "should gather report for a given time correctly" do
|
150
|
-
report = Wackamole::Mission.comb_applications( @test_time, false )
|
151
|
-
report.should have(1).item
|
152
|
-
report['fred'].should_not be_nil
|
153
|
-
report['fred']['envs'].should have(3).items
|
154
|
-
|
155
|
-
envs = %w[development production test]
|
156
|
-
expected = { 0 => 2, 1 => 2, 2 => 2}
|
157
|
-
report['fred']['envs'].each_pair do |env, info|
|
158
|
-
envs.include?( env ).should == true
|
159
|
-
envs = envs - [env]
|
160
|
-
info.should == expected
|
161
|
-
end
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
describe "#analyse_logs" do
|
166
|
-
before :all do
|
167
|
-
@db = Wackamole::Control.switch_mole_db!( "fred", "test" )
|
168
|
-
end
|
169
|
-
|
170
|
-
it "should find no analyses after 2am" do
|
171
|
-
test_time = Chronic.parse( "2010/01/01 02:00:00" ).utc
|
172
|
-
analysis = Wackamole::Mission.analyse_logs( @db, test_time, false )
|
173
|
-
[0, 1, 2].each{ |type| analysis[type].should == 0 }
|
174
|
-
end
|
175
|
-
|
176
|
-
it "should analyse a log for a given time correctly" do
|
177
|
-
test_time = Chronic.parse( "2010/01/01 01:00:00" ).utc
|
178
|
-
analysis = Wackamole::Mission.analyse_logs( @db, test_time, false )
|
179
|
-
[0, 1, 2].each{ |type| analysis[type].should == 2 }
|
180
|
-
end
|
181
|
-
|
182
|
-
it "should analyse logs for a day correctly" do
|
183
|
-
analysis = Wackamole::Mission.analyse_logs( @db, @test_time, true )
|
184
|
-
[0, 1, 2].each{ |type| analysis[type].should == 7 }
|
185
|
-
end
|
186
|
-
end
|
187
|
-
|
188
|
-
describe "#amend_report" do
|
189
|
-
it "should amend an empty report correctly" do
|
190
|
-
report = {}
|
191
|
-
%w[development test production].each do |env|
|
192
|
-
%w[feature fault perf].each do |type|
|
193
|
-
type_num = Rackamole.send( type )
|
194
|
-
log = { 'typ' => type_num }
|
195
|
-
Wackamole::Mission.amend_report( report, "fred", env, log )
|
196
|
-
report['fred']['envs'][env][type_num].should == 1
|
27
|
+
it "should pick up an app pulse correctly" do
|
28
|
+
pulse = Wackamole::Mission.pulse( @test_time )
|
29
|
+
pulse.should have(3).items
|
30
|
+
pulse[:to_date].should_not be_nil
|
31
|
+
pulse[:today].should_not be_nil
|
32
|
+
pulse[:last_tick].should_not be_nil
|
33
|
+
%w(to_date today).each do |p|
|
34
|
+
%w(production development test).each do |e|
|
35
|
+
[0, 1, 2].each do |type|
|
36
|
+
pulse[p.to_sym]["fred"][e][type].should == 7
|
197
37
|
end
|
198
38
|
end
|
199
39
|
end
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
%w[development test production].each do |env|
|
204
|
-
%w[feature fault perf].each do |type|
|
205
|
-
type_num = Rackamole.send( type )
|
206
|
-
log = { 'typ' => type_num }
|
207
|
-
Wackamole::Mission.amend_report( report, "fred", env, log )
|
208
|
-
report['fred']['envs'][env][type_num].should == 1
|
209
|
-
end
|
40
|
+
%w(production development test).each do |e|
|
41
|
+
[0, 1, 2].each do |type|
|
42
|
+
pulse[:last_tick]["fred"][e][type].should == 2
|
210
43
|
end
|
211
44
|
end
|
212
|
-
|
213
|
-
it "should amend an existing report correctly" do
|
214
|
-
report = { "fred" => {'envs' => { 'test' => { 0 => 1, 1 => 1, 2 => 1 } } }}
|
215
|
-
%w[development test production].each do |env|
|
216
|
-
%w[feature fault perf].each do |type|
|
217
|
-
type_num = Rackamole.send( type )
|
218
|
-
log = { 'typ' => type_num }
|
219
|
-
Wackamole::Mission.amend_report( report, "fred", env, log )
|
220
|
-
report['fred']['envs'][env][type_num].should == (env == "test" ? 2 : 1)
|
221
|
-
end
|
222
|
-
end
|
223
|
-
end
|
224
45
|
end
|
225
46
|
end
|