scout 2.0.7 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +15 -0
- data/Rakefile +14 -59
- data/data/cacert.pem +3154 -0
- data/data/gpl-2.0.txt +339 -0
- data/data/lgpl-2.1.txt +504 -0
- data/lib/scout.rb +4 -4
- data/lib/scout/command.rb +9 -0
- data/lib/scout/command/test.rb +8 -6
- data/lib/scout/plugin.rb +17 -6
- data/lib/scout/server.rb +127 -123
- data/vendor/json_pure/CHANGES +119 -0
- data/vendor/json_pure/GPL +340 -0
- data/vendor/json_pure/README +78 -0
- data/vendor/json_pure/RUBY +58 -0
- data/vendor/json_pure/Rakefile +270 -0
- data/vendor/json_pure/TODO +1 -0
- data/vendor/json_pure/VERSION +1 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
- data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
- data/vendor/json_pure/benchmarks/generator_benchmark.rb +165 -0
- data/vendor/json_pure/benchmarks/parser_benchmark.rb +197 -0
- data/vendor/json_pure/bin/edit_json.rb +9 -0
- data/vendor/json_pure/bin/prettify_json.rb +75 -0
- data/vendor/json_pure/data/example.json +1 -0
- data/vendor/json_pure/data/index.html +38 -0
- data/vendor/json_pure/data/prototype.js +4184 -0
- data/vendor/json_pure/doc-templates/main.txt +283 -0
- data/vendor/json_pure/ext/json/ext/generator/extconf.rb +11 -0
- data/vendor/json_pure/ext/json/ext/generator/generator.c +919 -0
- data/vendor/json_pure/ext/json/ext/generator/unicode.c +182 -0
- data/vendor/json_pure/ext/json/ext/generator/unicode.h +53 -0
- data/vendor/json_pure/ext/json/ext/parser/extconf.rb +11 -0
- data/vendor/json_pure/ext/json/ext/parser/parser.c +1829 -0
- data/vendor/json_pure/ext/json/ext/parser/parser.rl +686 -0
- data/vendor/json_pure/ext/json/ext/parser/unicode.c +154 -0
- data/vendor/json_pure/ext/json/ext/parser/unicode.h +58 -0
- data/vendor/json_pure/install.rb +26 -0
- data/vendor/json_pure/lib/json.rb +10 -0
- data/vendor/json_pure/lib/json/Array.xpm +21 -0
- data/vendor/json_pure/lib/json/FalseClass.xpm +21 -0
- data/vendor/json_pure/lib/json/Hash.xpm +21 -0
- data/vendor/json_pure/lib/json/Key.xpm +73 -0
- data/vendor/json_pure/lib/json/NilClass.xpm +21 -0
- data/vendor/json_pure/lib/json/Numeric.xpm +28 -0
- data/vendor/json_pure/lib/json/String.xpm +96 -0
- data/vendor/json_pure/lib/json/TrueClass.xpm +21 -0
- data/vendor/json_pure/lib/json/add/core.rb +135 -0
- data/vendor/json_pure/lib/json/add/rails.rb +58 -0
- data/vendor/json_pure/lib/json/common.rb +354 -0
- data/vendor/json_pure/lib/json/editor.rb +1371 -0
- data/vendor/json_pure/lib/json/ext.rb +15 -0
- data/vendor/json_pure/lib/json/json.xpm +1499 -0
- data/vendor/json_pure/lib/json/pure.rb +77 -0
- data/vendor/json_pure/lib/json/pure/generator.rb +430 -0
- data/vendor/json_pure/lib/json/pure/parser.rb +269 -0
- data/vendor/json_pure/lib/json/version.rb +8 -0
- data/vendor/json_pure/tests/fixtures/fail1.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail10.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail11.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail12.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail13.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail14.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail18.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail19.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail2.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail20.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail21.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail22.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail23.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail24.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail25.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail27.json +2 -0
- data/vendor/json_pure/tests/fixtures/fail28.json +2 -0
- data/vendor/json_pure/tests/fixtures/fail3.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail4.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail5.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail6.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail7.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail8.json +1 -0
- data/vendor/json_pure/tests/fixtures/fail9.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass1.json +56 -0
- data/vendor/json_pure/tests/fixtures/pass15.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass16.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass17.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass2.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass26.json +1 -0
- data/vendor/json_pure/tests/fixtures/pass3.json +6 -0
- data/vendor/json_pure/tests/test_json.rb +312 -0
- data/vendor/json_pure/tests/test_json_addition.rb +164 -0
- data/vendor/json_pure/tests/test_json_fixtures.rb +34 -0
- data/vendor/json_pure/tests/test_json_generate.rb +106 -0
- data/vendor/json_pure/tests/test_json_rails.rb +146 -0
- data/vendor/json_pure/tests/test_json_unicode.rb +62 -0
- data/vendor/json_pure/tools/fuzz.rb +139 -0
- data/vendor/json_pure/tools/server.rb +61 -0
- metadata +120 -6
- data/lib/scout/command/clone.rb +0 -21
- data/setup.rb +0 -1360
- data/test/scout_test.rb +0 -91
data/test/scout_test.rb
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require File.dirname(__FILE__) + '/../lib/scout'
|
3
|
-
require "logger"
|
4
|
-
|
5
|
-
class ScoutTest < Test::Unit::TestCase
|
6
|
-
|
7
|
-
SCOUT_TEST_SERVER = "http://localhost:4000/"
|
8
|
-
SCOUT_TEST_VALID_CLIENT_KEY = "valid key goes here"
|
9
|
-
SCOUT_TEST_VALID_PLUGIN_ID = "valid plugin id goes here"
|
10
|
-
|
11
|
-
def setup
|
12
|
-
@log = Logger.new('test.log')
|
13
|
-
@scout_server = create_scout_server(SCOUT_TEST_SERVER,
|
14
|
-
SCOUT_TEST_VALID_CLIENT_KEY)
|
15
|
-
end
|
16
|
-
|
17
|
-
def teardown
|
18
|
-
File.delete('test.log')
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_create
|
22
|
-
assert @scout_server
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_should_initialize_new_server
|
26
|
-
["@history_file", "@client_key", "@logger", "@server", "@history"].each do |var|
|
27
|
-
assert @scout_server.instance_variables.include?(var)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_should_send_report
|
32
|
-
report = {:server_load => "99.99"}
|
33
|
-
assert_does_not_exit { @scout_server.send_report(report, SCOUT_TEST_VALID_PLUGIN_ID) }
|
34
|
-
assert_log_contains("Report sent")
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_should_not_send_report_with_invalid_client_key
|
38
|
-
@scout_server_invalid_client_key = create_scout_server(SCOUT_TEST_SERVER,
|
39
|
-
"1111-2222-3333-4444-5555")
|
40
|
-
report = {:server_load => "99.99"}
|
41
|
-
assert_does_exit { @scout_server_invalid_client_key.send_report(report, SCOUT_TEST_VALID_PLUGIN_ID) }
|
42
|
-
assert_log_contains("Unable to send report to server")
|
43
|
-
assert_log_contains("An HTTP error occurred: exit")
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_should_not_send_report_with_invalid_plugin_id
|
47
|
-
report = {:server_load => "99.99"}
|
48
|
-
assert_does_exit { @scout_server.send_report(report, 9999999999) }
|
49
|
-
assert_log_contains("Unable to send report to server")
|
50
|
-
assert_log_contains("An HTTP error occurred: exit")
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_should_not_send_report_with_plugin_not_belonging_to_client
|
54
|
-
report = {:server_load => "99.99"}
|
55
|
-
assert_does_exit { @scout_server.send_report(report, 4) }
|
56
|
-
assert_log_contains("Unable to send report to server")
|
57
|
-
assert_log_contains("An HTTP error occurred: exit")
|
58
|
-
end
|
59
|
-
|
60
|
-
def create_scout_server(server, client_key, history=File.join("/tmp", "client_history.yaml"), logger=@log)
|
61
|
-
Scout::Server.new(server, client_key, history, logger)
|
62
|
-
end
|
63
|
-
|
64
|
-
def assert_log_contains(pattern)
|
65
|
-
@log_file = File.read('test.log')
|
66
|
-
assert @log_file.include?(pattern), "log does not include the pattern:\n#{pattern}\nlog contains:\n#{@log_file}"
|
67
|
-
end
|
68
|
-
|
69
|
-
# asserts that the program actually exits, terminating.
|
70
|
-
def assert_does_exit(&block)
|
71
|
-
begin
|
72
|
-
yield
|
73
|
-
rescue SystemExit
|
74
|
-
assert true, "Expected program to not exit, but program did exit."
|
75
|
-
return
|
76
|
-
end
|
77
|
-
flunk "Expected program to exit, but program did not exit."
|
78
|
-
end
|
79
|
-
|
80
|
-
# asserts that the program does not exit.
|
81
|
-
def assert_does_not_exit(&block)
|
82
|
-
begin
|
83
|
-
yield
|
84
|
-
rescue SystemExit
|
85
|
-
flunk "Expected program to not exit, but program did exit."
|
86
|
-
return
|
87
|
-
end
|
88
|
-
assert true, "Expected program to not exit, but program did exit."
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|