Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update protocol tests #2988

Merged
merged 174 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
9294373
Replace existing protocol tests with Smithy C2j protocol tests
jterapin Feb 22, 2024
56f1e5d
Clean up protocol-tests runner
jterapin Feb 23, 2024
17ab1aa
Make response headers more permissible if no headers in tests
jterapin Feb 23, 2024
cecba46
Add specific content-type adjustments to ec2 and query protocols
jterapin Feb 23, 2024
77cf461
Revert "Add specific content-type adjustments to ec2 and query protoc…
jterapin Feb 23, 2024
f7aab68
Add specific content-type adjustments to ec2 and query protocols
jterapin Feb 23, 2024
7b15bcb
Fix expectation of Content Type existence
jterapin Feb 23, 2024
e6eb2bf
Allow mocking of IdempotencyToken
jterapin Feb 23, 2024
79a371c
Add short as shape
jterapin Feb 26, 2024
dda8826
Update spacing to match smithy definition
jterapin Feb 27, 2024
3a37caa
Ensure headers values are strings when StringShape
jterapin Feb 27, 2024
b58ac08
Update host/uri matchers to cover custom paths
jterapin Feb 27, 2024
5959242
Implement a temporary skip test mechanism
jterapin Feb 28, 2024
9aed176
Fix bug in SAX parsing - ignore xmlns when parsing shapes
alextwoods Feb 29, 2024
6aaf09c
Update ignore list path
jterapin Feb 29, 2024
5c3f5b3
Update param validation to allow nil values
jterapin Feb 29, 2024
f0da244
Fix XML deserializing empty blobs from nil to empty string
jterapin Feb 29, 2024
4d68828
Allow nil values in lists and maps
jterapin Feb 29, 2024
b1b3af6
Add Content Type for rest-xml protocol
jterapin Feb 29, 2024
5898ee2
Update Content Type when payload is Blob or String shape
jterapin Feb 29, 2024
2c8156d
Fix path
jterapin Mar 1, 2024
f660bff
Update protocol-tests
jterapin Mar 1, 2024
709c305
Allow nil values in lists and maps
jterapin Mar 1, 2024
19453f6
Update format data to handle nil as values for list and maps
jterapin Mar 1, 2024
805c6f7
Add Nan/Infinity handling, remove nan/float test cases from ignore list
alextwoods Mar 1, 2024
2001eaf
Ensure keys in query maps do not overwrite modeled query keys
alextwoods Mar 4, 2024
c2a857e
Fix time parsing to output fractional secs
jterapin Mar 1, 2024
f401aa8
Update ignore mechanism and its list
jterapin Mar 4, 2024
7da9cfd
Update protocol-tests
jterapin Mar 4, 2024
6496eaa
Update ignore mechanism and its list based on feedback
jterapin Mar 4, 2024
8c5b28e
Update protocol-tests
jterapin Mar 5, 2024
65205d4
Fix Strings from converting
jterapin Mar 5, 2024
0a2f055
Fix indexing to cover :unknown shapes
jterapin Mar 5, 2024
63170ae
Fix xml_name to return location_name regardless of flattened
jterapin Mar 5, 2024
cdd360a
Fix timestamp format for uri bindings
jterapin Mar 5, 2024
76e1d71
Merge branch 'version-3' into update_protocol_tests
jterapin Mar 6, 2024
77e719c
Fix timestamp values in list headers are serialized correctly
jterapin Mar 5, 2024
a72ca77
Delete whitespace
jterapin Mar 5, 2024
7bdb71d
Fix logic for timestamp values in header lists
jterapin Mar 5, 2024
ed8a339
Update protocol-tests source and ignore list
jterapin Mar 5, 2024
eef3d27
Fix rendering of empty strings in headers
jterapin Mar 5, 2024
265b79d
Update ignore list
jterapin Mar 5, 2024
c30bcbe
Fix flattened lists in query
jterapin Mar 5, 2024
65768fd
Fix jsonvalue convverter spec to match the updated behavior
jterapin Mar 6, 2024
459faec
Update protocol-tests source
jterapin Mar 6, 2024
ebf2923
Update xml parser spec tests to match the fixed behavior
jterapin Mar 6, 2024
8b65ddd
Update query builder and specs to handle flattened list members corre…
jterapin Mar 7, 2024
c036185
Update to ensure timestamp param values are strings
jterapin Mar 7, 2024
af9e152
Update protocol-tests source
jterapin Mar 7, 2024
4cd9e57
Update ignore list
jterapin Mar 8, 2024
eecad13
Add content-type to omit in signed headers
jterapin Mar 8, 2024
4a5dc4e
Fix spec to match timestamps
jterapin Mar 8, 2024
6524689
Fix empty blobs payloads
jterapin Mar 8, 2024
8622a3b
Update reasons for error-based cases
jterapin Mar 8, 2024
eeee176
Fix flattened xml members to render their own location name
jterapin Mar 8, 2024
c087cb4
Fix flattened xml members to render their own location name for lists
jterapin Mar 8, 2024
12369e6
Update ignore list
jterapin Mar 8, 2024
01e9dbb
Update protocol-tests source
jterapin Mar 8, 2024
1aeddf1
Update to handle different formats of xmlNamespace
jterapin Mar 11, 2024
5aa09e0
Fix xml namespace behavior on nested structs
jterapin Mar 11, 2024
292fc0a
Slight tweak on fix to xml nested namespace
alextwoods Mar 11, 2024
5cf5394
Update ignore list
jterapin Mar 11, 2024
ce60e61
Update entry nodes to contain empty refs
jterapin Mar 11, 2024
651defd
Update test runner to handle empty strings as expected body
jterapin Mar 12, 2024
e8bd679
Update existing spec relating to flattened lists and member locationN…
jterapin Mar 12, 2024
af7c158
Update spec wording
jterapin Mar 12, 2024
6f43923
Update location name reference
jterapin Mar 13, 2024
fd4728e
Set locationName to true to recongize in shapes
jterapin Mar 13, 2024
7db4b86
Update ignore list
jterapin Mar 13, 2024
aafc5b0
Update xml namespaces spec to match the fixed behavior
jterapin Mar 13, 2024
76210d6
Update to allow top level input to use defined location name on shape
jterapin Mar 13, 2024
0448478
Revert "Update param validation to allow nil values"
jterapin Mar 13, 2024
4bde759
Revert "Update format data to handle nil as values for list and maps"
jterapin Mar 13, 2024
d5a49dd
Update protocol-tests source
jterapin Mar 14, 2024
9392873
Update to allow using locationName defined on shape for operation ref
jterapin Mar 14, 2024
77c80ce
Revert "Update to allow top level input to use defined location name …
jterapin Mar 14, 2024
2f50b1c
Fix mistype
jterapin Mar 14, 2024
f386f6d
Update ignore list
jterapin Mar 14, 2024
c214de2
Update ignore list
jterapin Mar 14, 2024
bc243c4
Add support for parsing headers with list of escaped strings + timest…
alextwoods Mar 18, 2024
631ab96
Backport cleanups from smithy-ruby
alextwoods Mar 19, 2024
e2b9fd5
Update error handler to have headers
jterapin Mar 18, 2024
d6b5e1b
Handle error cases
jterapin Mar 18, 2024
1e142a3
Update ignore list
jterapin Mar 19, 2024
ecb29b3
Update ignore list
jterapin Mar 19, 2024
e3f0c35
Parse errors in xml responses by extracting expected error member
alextwoods Mar 19, 2024
df31e8e
Update protocol-tests source
jterapin Mar 20, 2024
4d7360c
Update ignore list
jterapin Mar 20, 2024
a91ce96
Set back the header
jterapin Mar 20, 2024
d2d1310
Update test runner to handle case-sensitive headers extracted from pr…
jterapin Mar 20, 2024
68c8808
Update to allow error metadata
jterapin Mar 20, 2024
9ff0f69
Update to add headers for error data
jterapin Mar 20, 2024
57f9750
Update body builder to handler rest-xml payload
jterapin Mar 20, 2024
43469e4
Update where underscore is being used from
jterapin Mar 21, 2024
9865311
Update to handle cases when body is nil
jterapin Mar 21, 2024
b4f1002
Revert "Update to handle cases when body is nil"
jterapin Mar 22, 2024
adaf82d
Update shape with streaming trait as this file is intended for stream…
jterapin Mar 22, 2024
ad3c6f1
Update to include streaming for deserializing empty blob body
jterapin Mar 22, 2024
626eafc
Update api-gateway protocol-tests with updated format
jterapin Mar 22, 2024
45e8db2
Revert "Update to include streaming for deserializing empty blob body"
jterapin Mar 22, 2024
6bebb1b
Add extra protocol tests
jterapin Mar 22, 2024
2a443cb
Reapply "Update to include streaming for deserializing empty blob body"
jterapin Mar 22, 2024
fdb1572
Clean up test runner
jterapin Mar 22, 2024
5b99475
Rearrange shape keys
jterapin Mar 25, 2024
830d1b0
Tidy up error handlers
jterapin Mar 25, 2024
466d5eb
Clean up building payload body
jterapin Mar 25, 2024
d0530f1
Clean up endpoint changes
jterapin Mar 25, 2024
c3c9eb2
Clean up header lists in rest request
jterapin Mar 25, 2024
6e96636
Tidy up rest protocol
jterapin Mar 25, 2024
6cdb53a
Consume latest protocol-tests source (to be reverted)
jterapin Mar 25, 2024
899fcb2
Revert "Consume latest protocol-tests source (to be reverted)"
jterapin Mar 25, 2024
797891e
Reapply "Consume latest protocol-tests source (to be reverted)"
jterapin Mar 25, 2024
b84a34d
Consume latest protocol-tests source
jterapin Mar 25, 2024
7afe8fd
Update ignore list
jterapin Mar 25, 2024
150fa36
Add ContentType handler for rest protocol
jterapin Mar 25, 2024
867005a
Add priority to rest-json content type handler
jterapin Mar 25, 2024
e862028
Fix mistype
jterapin Mar 25, 2024
ac56692
Update to render custom err code if it is defined
jterapin Mar 27, 2024
7fe3dfd
Update protocol-tests source
jterapin Mar 27, 2024
2940130
Add changelogs
jterapin Mar 27, 2024
c0df1e7
Add small changes
jterapin Mar 27, 2024
cdd7dcc
Add minor updates
jterapin Mar 27, 2024
00d999a
Add minor tweaks
jterapin Mar 28, 2024
3811f75
Merge branch 'version-3' into update_protocol_tests
jterapin Mar 28, 2024
114a2a6
Merge branch 'version-3' into update_protocol_tests
jterapin Mar 28, 2024
dbcac57
Revert "Add short as shape"
jterapin Apr 2, 2024
ca5d08f
Remove change regarding short as supported type
jterapin Apr 2, 2024
ecebe5e
Update matcher methods to be self methods
jterapin Apr 2, 2024
0a66d2b
Create ignore_list memoized method
jterapin Apr 2, 2024
7a8106c
Update to use JSON.load instead of Aws::JSON
jterapin Apr 2, 2024
0a868f2
Update client_for method with correct default endpoint
jterapin Apr 2, 2024
a5d75fc
Update formatting
jterapin Apr 2, 2024
323c07c
Update protocol-tests source for testing
jterapin Apr 3, 2024
499fc30
Revert "Slight tweak on fix to xml nested namespace"
jterapin Apr 3, 2024
b14359a
Revert "Fix xml namespace behavior on nested structs"
jterapin Apr 3, 2024
700a517
Revert "Update xml namespaces spec to match the fixed behavior"
jterapin Apr 3, 2024
8efd8ea
Revert "Update protocol-tests source for testing"
jterapin Apr 3, 2024
417bb5f
Update test runner client to have no retries
jterapin Apr 3, 2024
291ec4b
Update protocol-tests source
jterapin Apr 3, 2024
5f5dd5a
Reapply "Update format data to handle nil as values for list and maps"
jterapin Apr 3, 2024
e0beebb
Update protocol-tests source
jterapin Apr 3, 2024
42c1466
Update JSON parser to drop key/value pair if value is nil for parsing…
jterapin Apr 3, 2024
f6c3e84
Fix S3 changelog
jterapin Apr 3, 2024
006a733
Revert "Fix Strings from converting"
jterapin Apr 3, 2024
715117f
Reapply "Fix Strings from converting"
jterapin Apr 3, 2024
b21e08f
Revert "Reapply "Fix Strings from converting""
jterapin Apr 3, 2024
ad1a275
Reapply "Reapply "Fix Strings from converting""
jterapin Apr 3, 2024
1d0e2cb
Move skip method to ProtocolTestHelper
jterapin Apr 3, 2024
6ec284e
Update formatting on handwritten protocol-test
jterapin Apr 3, 2024
cd02d3b
Remove http fallback on client creation
jterapin Apr 3, 2024
30a08ca
Add newline in changelog
jterapin Apr 4, 2024
6ccf866
Remove changelog entry regarding xmlNamespace
jterapin Apr 4, 2024
28a237a
Add comment regarding dropping nil values in dense maps
jterapin Apr 4, 2024
484d8b1
Update formatting
jterapin Apr 4, 2024
3d1e432
Merge branch 'version-3' into update_protocol_tests
jterapin Apr 4, 2024
4cc8a5f
Add comment for clarifying intent
jterapin Apr 4, 2024
c8851df
Refactor empty blob payload check
jterapin Apr 4, 2024
b3b348b
Refactor handling of passing payload name to xml builder
jterapin Apr 4, 2024
86f10fd
Revert "Reapply "Reapply "Fix Strings from converting"""
jterapin Apr 4, 2024
4d850db
Revert "Fix jsonvalue convverter spec to match the updated behavior"
jterapin Apr 4, 2024
8df5f93
Handle jsonValue specs in our test runner
jterapin Apr 4, 2024
c621eda
Remove changelog entry regarding jsonValue
jterapin Apr 5, 2024
57d2b53
Revert "Add comment regarding dropping nil values in dense maps"
jterapin Apr 5, 2024
f879bbb
Revert "Update JSON parser to drop key/value pair if value is nil for…
jterapin Apr 5, 2024
b7d33f2
Update ignore list to cull a newly added test case that needs clarifi…
jterapin Apr 5, 2024
5f0a5bc
Minor update
jterapin Apr 5, 2024
0618c97
Update format
jterapin Apr 8, 2024
13b6dd3
Rework handling of content-type header for rest requests
jterapin Apr 9, 2024
22071cd
Update core changelog
jterapin Apr 9, 2024
f7844e3
Update core changelog
jterapin Apr 10, 2024
195e7d7
Update comments for xml error handler
jterapin Apr 10, 2024
6347269
Update client api to only generate error info when protocol is query
jterapin Apr 12, 2024
3b688fc
Update min core version for s3
jterapin Apr 12, 2024
35ddbe8
Update changelog
jterapin Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,14 @@ def ruby_input_type(shape_ref, api, operation = nil, options = {})
end
when 'boolean' then 'Boolean'
when 'character' then 'String<character>'
when 'double' then 'Float'
when 'float' then 'Float'
when 'integer' then 'Integer'
when 'double', 'float' then 'Float'
when 'integer', 'long', 'short' then 'Integer'
when 'list'
if nested
"Array"
else
"Array<#{ruby_input_type(shape['member'], api, operation, nested: true)}>"
end
when 'long' then 'Integer'
when 'map'
if nested
"Hash"
Expand All @@ -96,11 +94,9 @@ def ruby_type(shape_ref, api)
when 'boolean' then 'Boolean'
when 'byte' then 'Integer<byte>'
when 'character' then 'String<character>'
when 'double' then 'Float'
when 'float' then 'Float'
when 'integer' then 'Integer'
when 'double', 'float' then 'Float'
when 'integer', 'long', 'short' then 'Integer'
when 'list' then "Array<#{ruby_type(shape['member'], api)}>"
when 'long' then 'Integer'
when 'map' then "Hash<String,#{ruby_type(shape['value'], api)}>"
when 'string' then streaming?(shape_ref, api) ? 'IO' : 'String'
when 'structure'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ def to_type(shape_ref, api)
when 'boolean' then 'bool'
when 'byte' then '::Integer'
when 'character' then '::String'
when 'double' then '::Float'
when 'float' then '::Float'
when 'integer' then '::Integer'
when 'double', 'float' then '::Float'
when 'integer', 'long', 'short' then '::Integer'
when 'list' then "::Array[#{to_type(shape['member'], api)}]"
when 'long' then '::Integer'
when 'map' then "::Hash[#{to_type(shape['key'], api)}, #{to_type(shape['value'], api)}]"
when 'string'
if shape['enum']
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ def ref_value(ref, i, visited)
end
when 'blob'
if ref['streaming']
"::String | ::StringIO | ::File" # input only
'::String | ::StringIO | ::File' # input only
else
"::String"
'::String'
end
when 'list' then list(s, i, visited)
when 'map' then map(s, i, visited)
when 'boolean' then "bool"
when 'integer', 'long' then '::Integer'
when 'boolean' then 'bool'
when 'integer', 'long', 'short' then '::Integer'
when 'float', 'double' then '::Float'
when 'byte' then '::Integer'
when 'character' then '::String'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ def ref_value(ref, i, visited)

when 'list' then list(s, i, visited)
when 'map' then map(s, i, visited)
when 'boolean' then "false"
when 'integer', 'long' then '1'
when 'boolean' then 'false'
when 'integer', 'long', 'short' then '1'
when 'float', 'double' then '1.0'
when 'byte' then '97'
when 'character' then '"a"'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class ClientApiModule < View

include Helper

SKIP_TRAITS = Set.new(%w(shape deprecated location locationName documentation))
SKIP_TRAITS = Set.new(%w[shape deprecated location locationName documentation])

SHAPE_CLASSES = {
'blob' => 'BlobShape',
Expand All @@ -16,13 +16,14 @@ class ClientApiModule < View
'double' => 'FloatShape',
'float' => 'FloatShape',
'integer' => 'IntegerShape',
'list' => 'ListShape',
'long' => 'IntegerShape',
'short' => 'IntegerShape',
'list' => 'ListShape',
'map' => 'MapShape',
'string' => 'StringShape',
'structure' => 'StructureShape',
'timestamp' => 'TimestampShape'
}
}.freeze

SHAPE_KEYS = {
# keep
Expand Down Expand Up @@ -65,7 +66,7 @@ class ClientApiModule < View
'wrapper' => false,
'xmlOrder' => false,
'retryable' => false,
}
}.freeze

METADATA_KEYS = {
# keep all
Expand All @@ -89,7 +90,7 @@ class ClientApiModule < View
'awsQueryCompatible' => true, # AwsQuery migration
# ignore
'ripServiceName' => true
}
}.freeze

# @option options [required, Service] :service
def initialize(options)
Expand Down Expand Up @@ -217,7 +218,7 @@ def operations
end
end

%w(input output).each do |key|
%w[input output].each do |key|
if operation[key]
o.shape_references << "o.#{key} = #{operation_ref(operation[key])}"
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,9 @@ module AwsSdkCodeGenerator
'float' => { 'shape' => 'Float' },
'integer' => { 'shape' => 'Integer' },
'long' => { 'shape' => 'Long' },
'short' => { 'shape' => 'Short' },
'string' => { 'shape' => 'StringShape' },
'timestamp' => { 'shape' => 'Timestamp' },
'timestamp' => { 'shape' => 'Timestamp' }
}
},
'Blob' => { 'type' => 'blob' },
Expand All @@ -454,7 +455,8 @@ module AwsSdkCodeGenerator
'Double' => { 'type' => 'double' },
'Float' => { 'type' => 'float' },
'Long' => { 'type' => 'long' },
'Timestamp' => { 'type' => 'timestamp' },
'Short' => { 'type' => 'short' },
'Timestamp' => { 'type' => 'timestamp' }
}
}
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
{
"ec2" :
{
"input" : [
"Ec2QuerySupportsNaNFloatInputs",
"Ec2QuerySupportsInfinityFloatInputs",
"Ec2QuerySupportsNegativeInfinityFloatInputs"
],
"output" : [
"Ec2QuerySupportsNaNFloatOutputs",
"Ec2QuerySupportsInfinityFloatOutputs",
"Ec2QuerySupportsNegativeInfinityFloatOutputs"
]
},
"json" : {
"input" : [
"AwsJson11SupportsNaNFloatInputs",
"AwsJson11SupportsInfinityFloatInputs",
"AwsJson11SupportsNegativeInfinityFloatInputs"
],
"output" : [

]
},
"json_1_0" : {
"input" : [
"AwsJson10SupportsNaNFloatInputs",
"AwsJson10SupportsInfinityFloatInputs",
"AwsJson10SupportsNegativeInfinityFloatInputs"
],
"output" : [

]
},
"query" : {
"input" : [
"AwsQuerySupportsNaNFloatInputs",
"AwsQuerySupportsInfinityFloatInputs",
"AwsQuerySupportsNegativeInfinityFloatInputs"
],
"output" : [
"AwsQuerySupportsNaNFloatOutputs",
"AwsQuerySupportsInfinityFloatOutputs",
"AwsQuerySupportsNegativeInfinityFloatOutputs"
]
},
"rest-json" : {
"input" : [
"RestJsonSupportsNaNFloatQueryValues",
"RestJsonSupportsInfinityFloatQueryValues",
"RestJsonSupportsNegativeInfinityFloatQueryValues",
"RestJsonHttpPayloadWithUnsetUnion",
"RestJsonSupportsNaNFloatLabels",
"RestJsonSupportsInfinityFloatLabels",
"RestJsonSupportsNegativeInfinityFloatLabels",
"RestJsonSupportsNaNFloatHeaderInputs",
"RestJsonSupportsInfinityFloatHeaderInputs",
"RestJsonSupportsNegativeInfinityFloatHeaderInputs",
"RestJsonSupportsNaNFloatInputs",
"RestJsonSupportsInfinityFloatInputs",
"RestJsonSupportsNegativeInfinityFloatInputs"
],
"output" : [
"RestJsonInputAndOutputWithQuotedStringHeaders",
"RestJsonSupportsNaNFloatHeaderOutputs",
"RestJsonSupportsInfinityFloatHeaderOutputs",
"RestJsonSupportsNegativeInfinityFloatHeaderOutputs"
]
},
"rest-xml" : {
"input" : [
"RestXmlSupportsNaNFloatQueryValues",
"RestXmlSupportsInfinityFloatQueryValues",
"RestXmlSupportsNegativeInfinityFloatQueryValues",
"RestXmlSupportsNaNFloatLabels",
"RestXmlSupportsInfinityFloatLabels",
"RestXmlSupportsNegativeInfinityFloatLabels",
"RestXmlSupportsNaNFloatHeaderInputs",
"RestXmlSupportsInfinityFloatHeaderInputs",
"RestXmlSupportsNegativeInfinityFloatHeaderInputs",
"RestXmlSupportsNaNFloatInputs",
"RestXmlSupportsInfinityFloatInputs",
"RestXmlSupportsNegativeInfinityFloatInputs"
],
"output" : [
"RestXmlSupportsNaNFloatHeaderOutputs",
"RestXmlSupportsInfinityFloatHeaderOutputs",
"RestXmlSupportsNegativeInfinityFloatHeaderOutputs",
"RestXmlSupportsNaNFloatOutputs",
"RestXmlSupportsInfinityFloatOutputs",
"RestXmlSupportsNegativeInfinityFloatOutputs"
]
},
"api-gateway" : {
"input" : [],
"output" : []
}
}
Loading
Loading