Skip to content

Commit 8fe5d96

Browse files
alextwoodsmullermp
andauthored
Add smoke test customizations and delete SMS/MTurk (#2843)
Co-authored-by: Matt Muller <[email protected]>
1 parent 70448d1 commit 8fe5d96

File tree

5 files changed

+30
-30
lines changed

5 files changed

+30
-30
lines changed

build_tools/customizations.rb

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module Customizations
66
@api_customizations = {}
77
@doc_customizations = {}
88
@example_customizations = {}
9+
@smoke_customizations = {}
910

1011
class << self
1112

@@ -21,6 +22,10 @@ def example(svc_name, &block)
2122
@example_customizations[svc_name] = block
2223
end
2324

25+
def smoke(svc_name, &block)
26+
@smoke_customizations[svc_name] = block
27+
end
28+
2429
def apply_api_customizations(svc_name, api)
2530
@api_customizations[svc_name].call(api) if @api_customizations[svc_name]
2631
end
@@ -33,6 +38,10 @@ def apply_example_customizations(svc_name, examples)
3338
@example_customizations[svc_name].call(examples) if @example_customizations[svc_name]
3439
end
3540

41+
def apply_smoke_customizations(svc_name, smoke)
42+
@smoke_customizations[svc_name].call(smoke) if @smoke_customizations[svc_name]
43+
end
44+
3645
private
3746

3847
def dynamodb_example_deep_transform(subsegment, keys)
@@ -104,7 +113,6 @@ def dynamodb_example_deep_transform(subsegment, keys)
104113
end
105114

106115
%w(Lambda LambdaPreview).each do |svc_name|
107-
108116
api(svc_name) do |api|
109117
api['shapes']['Timestamp']['type'] = 'timestamp'
110118
end
@@ -113,7 +121,10 @@ def dynamodb_example_deep_transform(subsegment, keys)
113121
docs['shapes']['Blob']['refs']['UpdateFunctionCodeRequest$ZipFile'] =
114122
"<p>.zip file containing your packaged source code.</p>"
115123
end
124+
end
116125

126+
smoke('MTurk') do |smoke|
127+
smoke['testCases'] = []
117128
end
118129

119130
# Cross Region Copying
@@ -201,6 +212,10 @@ def dynamodb_example_deep_transform(subsegment, keys)
201212
end
202213
end
203214

215+
smoke('SMS') do |smoke|
216+
smoke['testCases'] = []
217+
end
218+
204219
api('SQS') do |api|
205220
api['metadata']['errorPrefix'] = 'AWS.SimpleQueueService.'
206221
api['shapes']['StringList']['flattened'] = true

build_tools/services.rb

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def build_service(svc_name, config)
6363
waiters: model_path('waiters-2.json', config['models']),
6464
resources: model_path('resources-1.json', config['models']),
6565
examples: load_examples(svc_name, config['models']),
66-
smoke_tests: model_path('smoke.json', config['models']),
66+
smoke_tests: load_smoke(svc_name, config['models']),
6767
legacy_endpoints: config.fetch('legacyEndpoints', false),
6868
endpoint_rules: model_path('endpoint-rule-set-1.json', config['models']),
6969
endpoint_tests: model_path('endpoint-tests-1.json', config['models']),
@@ -96,6 +96,17 @@ def load_examples(svc_name, models_dir)
9696
end
9797
end
9898

99+
def load_smoke(svc_name, models_dir)
100+
path = model_path('smoke.json', models_dir)
101+
if path
102+
smoke = JSON.load(File.read(path))
103+
BuildTools::Customizations.apply_smoke_customizations(svc_name, smoke)
104+
smoke
105+
else
106+
nil
107+
end
108+
end
109+
99110
def add_plugins(api, plugins)
100111
plugins << EVENTSTREAM_PLUGIN if eventstream?(api)
101112
plugins.inject({}) do |hash, plugin|

gems/aws-sdk-mturk/features/smoke.feature

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,3 @@ Feature: Smoke tests for MTurk
99

1010
Background:
1111
Given I create a client in region 'us-east-1'
12-
13-
@mturk @smoke
14-
Scenario: Call Aws::MTurk::Client#get_account_balance and expect it to succeed
15-
When I call the operation 'get_account_balance' with params:
16-
"""
17-
{}
18-
"""
19-
Then I expect an error was not raised

gems/aws-sdk-sms/features/smoke.feature

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,3 @@ Feature: Smoke tests for SMS
99

1010
Background:
1111
Given I create a client in region 'us-west-2'
12-
13-
@sms @smoke
14-
Scenario: Call Aws::SMS::Client#get_connectors and expect it to succeed
15-
When I call the operation 'get_connectors' with params:
16-
"""
17-
{}
18-
"""
19-
Then I expect an error was not raised
20-
21-
@sms @smoke
22-
Scenario: Call Aws::Aws::SMS::Client#delete_replication_job and expect it to fail
23-
When I call the operation 'delete_replication_job' with params:
24-
"""
25-
{"replication_job_id":"invalidId"}
26-
"""
27-
Then I expect an error was raised

tasks/test.rake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,15 @@ end
4747

4848
rule /^test:features:.+$/ do |task|
4949
dir = "gems/#{task.name.split(':').last}/features"
50-
# skip mturk because it requires account setup
51-
tags = "-t 'not @veryslow' -t 'not @mturk'"
50+
tags = "-t 'not @veryslow'"
5251
sh("bundle exec cucumber --retry 3 #{tags} -r #{dir} #{dir} --publish-quiet")
5352
end
5453

5554
desc 'Executes integration tests.'
5655
task 'test:features' do
5756
failures = []
5857
Dir.glob('gems/*/features').each do |dir|
59-
# skip mturk because it requires account setup
60-
tags = "-t 'not @veryslow' -t 'not @mturk'"
58+
tags = "-t 'not @veryslow'"
6159
sh("bundle exec cucumber --retry 3 #{tags} -r #{dir} #{dir} --publish-quiet") do |ok, _|
6260
failures << File.basename(File.dirname(dir)) unless ok
6361
end

0 commit comments

Comments
 (0)