esp_sdk 2.7.0 → 2.8.0
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +36 -35
- data/.travis.yml +2 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile.lock +63 -85
- data/Rakefile +2 -1
- data/esp_sdk.gemspec +3 -4
- data/lib/esp/aws_clients.rb +2 -2
- data/lib/esp/commands/add_external_account.rb +1 -1
- data/lib/esp/commands/commands_tasks.rb +2 -2
- data/lib/esp/extensions/active_resource/formats/json_api_format.rb +24 -16
- data/lib/esp/extensions/active_resource/validations.rb +1 -1
- data/lib/esp/resources/alert.rb +3 -2
- data/lib/esp/resources/custom_signature/definition.rb +2 -2
- data/lib/esp/resources/dashboard.rb +2 -5
- data/lib/esp/resources/resource.rb +14 -15
- data/lib/esp/resources/stat.rb +2 -5
- data/lib/esp/resources/suppression.rb +1 -1
- data/lib/esp/version.rb +1 -1
- data/test/esp/integration/custom_signature_definition_integration_test.rb +15 -1
- data/test/esp/integration/custom_signature_integration_test.rb +3 -1
- data/test/esp/integration/custom_signature_result_alert_integration_test.rb +4 -4
- data/test/esp/integration/custom_signature_result_integration_test.rb +2 -1
- data/test/esp/integration/json_api_format_integration_test.rb +1 -1
- data/test/esp/integration/suppression_integration_test.rb +1 -1
- data/test/esp/integration/suppression_unique_identifier_integration_test.rb +1 -1
- data/test/esp/resources/custom_signature/definition_test.rb +1 -1
- data/test/esp/resources/custom_signature_test.rb +1 -1
- data/test/esp/resources/external_account_test.rb +1 -1
- data/test/esp/resources/organization_test.rb +6 -6
- data/test/esp/resources/service_test.rb +1 -1
- data/test/esp/resources/sub_organization_test.rb +3 -3
- data/test/esp/resources/team_test.rb +2 -2
- data/test/factories/contact_requests.rb +1 -2
- data/test/factories/custom_signature/definitions.rb +1 -2
- data/test/factories/dashboards.rb +1 -2
- data/test/factories/external_accounts.rb +1 -2
- data/test/factories/organizations.rb +1 -2
- data/test/factories/reports.rb +1 -2
- data/test/factories/scan_intervals.rb +1 -2
- data/test/factories/stat_custom_signatures.rb +1 -2
- data/test/factories/stat_regions.rb +1 -2
- data/test/factories/stat_services.rb +1 -2
- data/test/factories/stat_signautures.rb +1 -2
- data/test/factories/stats.rb +1 -2
- data/test/factories/sub_organizations.rb +1 -2
- data/test/factories/suppression/regions.rb +2 -4
- data/test/factories/suppression/signatures.rb +2 -4
- data/test/factories/suppression/unique_identifiers.rb +2 -4
- data/test/factories/suppressions.rb +1 -2
- data/test/factories/users.rb +1 -2
- data/test/test_helper.rb +3 -10
- metadata +11 -28
- data/lib/tasks/testing.rake +0 -3
- data/test/parallel_reporter.rb +0 -93
data/lib/tasks/testing.rake
DELETED
data/test/parallel_reporter.rb
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
require 'ansi/code'
|
2
|
-
|
3
|
-
module Minitest
|
4
|
-
module Reporters
|
5
|
-
# Features:
|
6
|
-
# Like the SpecReporter but with the pass/time on the left
|
7
|
-
# Collects the message before doing a puts so that lines dont get mixed up when running tests in threads
|
8
|
-
# Highlights lines in a stacktrace from this project
|
9
|
-
# Highlights slow tests
|
10
|
-
class ParallelReporter < BaseReporter
|
11
|
-
# fix coloring for parallel_tests
|
12
|
-
require 'ansi/code'
|
13
|
-
include ::ANSI::Code
|
14
|
-
extend ::ANSI::Code
|
15
|
-
|
16
|
-
include RelativePosition
|
17
|
-
|
18
|
-
def report
|
19
|
-
super
|
20
|
-
msg = "\n"
|
21
|
-
msg += "Finished in #{format('%f', total_time)}s"
|
22
|
-
msg += "\n"
|
23
|
-
msg += "#{format('%d', count)} tests, #{format('%d', assertions)} assertions, "
|
24
|
-
color = failures.zero? && errors.zero? ? :green : :red
|
25
|
-
msg += send(color) { "#{format('%d', failures)} failures, #{format('%d', errors)} errors, " }
|
26
|
-
msg += yellow { "#{format('%d', skips)} skips" }
|
27
|
-
msg += "\n"
|
28
|
-
puts msg
|
29
|
-
end
|
30
|
-
|
31
|
-
def record(test)
|
32
|
-
super
|
33
|
-
if test.passed?
|
34
|
-
print_pass(test)
|
35
|
-
else
|
36
|
-
print_fail(test)
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
private
|
41
|
-
|
42
|
-
def print_pass(_test)
|
43
|
-
print green '.'
|
44
|
-
end
|
45
|
-
|
46
|
-
def print_fail(test)
|
47
|
-
puts ''
|
48
|
-
msg = ''
|
49
|
-
msg += colored_status(test)
|
50
|
-
msg += color_by_time(" (#{format('%.2f', test.time)}s)", test.time)
|
51
|
-
msg += pad_test(test.name).gsub('test_: ', "[#{blue ENV['TEST_ENV_NUMBER'].to_i}] ")
|
52
|
-
msg += stacktrace(test)
|
53
|
-
puts msg
|
54
|
-
puts ''
|
55
|
-
end
|
56
|
-
|
57
|
-
def color_by_time(string, time)
|
58
|
-
if time > 5
|
59
|
-
red string
|
60
|
-
elsif time > 1
|
61
|
-
yellow string
|
62
|
-
else
|
63
|
-
string
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
def colored_status(test)
|
68
|
-
if test.passed?
|
69
|
-
green { pad_mark(result(test).to_s.upcase) }
|
70
|
-
elsif test.skipped?
|
71
|
-
yellow { pad_mark(result(test).to_s.upcase) }
|
72
|
-
else
|
73
|
-
red { pad_mark(result(test).to_s.upcase) }
|
74
|
-
end
|
75
|
-
end
|
76
|
-
|
77
|
-
def stacktrace(test) # rubocop:disable Metrics/MethodLength
|
78
|
-
return '' unless !test.skipped? && test.failure
|
79
|
-
msg = "\n"
|
80
|
-
msg += red(test.failure.message.split("\n ").first.to_s) + "\n"
|
81
|
-
test.failure.backtrace.each do |line|
|
82
|
-
msg += if line.include?('esp_sdk/lib')
|
83
|
-
yellow line
|
84
|
-
else
|
85
|
-
line
|
86
|
-
end
|
87
|
-
msg += "\n"
|
88
|
-
end
|
89
|
-
msg
|
90
|
-
end
|
91
|
-
end
|
92
|
-
end
|
93
|
-
end
|