Skip to content

add recorpused rpcv2json protocol tests - #3254

Merged
JordonPhillips merged 3 commits into
smithy-lang:mainfrom
lucix-aws:rpcv2json-protocol-tests
Oct 28, 2026
Merged

JordonPhillips merged 3 commits into
smithy-lang:mainfrom
lucix-aws:rpcv2json-protocol-tests

Conversation

@lucix-aws

Copy link
Copy Markdown
Contributor

Adds a new rpcv2json (+querycompatible) protocol test suite under our new corpus strategy.

Note that the models here do not build w/o #3248.

Generated and ran these new tests against aws/smithy-go#695.

@lucix-aws
lucix-aws requested a review from a team as a code owner August 13, 2026 20:52
@lucix-aws
lucix-aws requested a review from joewyz August 13, 2026 20:52
@lucix-aws

lucix-aws commented Aug 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Organizationally I don't know where these need to end up, right now because of what we're doing with the naming traits, @ec2QueryName is everywhere and so I just put this under a v2/ in smithy-aws-protocol-tests, but I realize that's probably not what we want. resolved

@lucix-aws
lucix-aws force-pushed the rpcv2json-protocol-tests branch from b738cee to 7a3ec4e Compare August 14, 2026 16:30

@JordonPhillips JordonPhillips left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these all need a nice smithy format run too. Though please do that as a separate commit for now as it'll be impossible to review the diff otherwise.

}
])

apply NoInputOutput @httpRequestTests([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test for the output being a unit type too

use smithy.test#httpRequestTests
use smithy.test#httpResponseTests

apply QueryCompatErrorOp @httpRequestTests([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also have a test asserting that the compat header isn't sent if compat mode isn't enabled

}
])

apply QueryCompatError @httpResponseTests([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to use forbidHeaders

Comment on lines +17 to +18
input: QueryCompatErrorOpInput
output: QueryCompatErrorOpOutput

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be using inline IO everywhere unless there's a specific reason not to.

Comment on lines +30 to +40
defaultBoolean: Boolean = false
defaultByte: Byte = 0
defaultShort: Short = 0
defaultInteger: Integer = 0
defaultLong: Long = 0
defaultFloat: Float = 0
defaultDouble: Double = 0
defaultString: String = ""
defaultBlob: Blob = ""
defaultEnum: CorpusStringEnum = "Foo"
defaultIntEnum: CorpusIntEnum = 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These defaults are identical to the zero values, and this very same structure has separate zero value members. Best to change them to something else.

headerEvent: HeaderEvent
}

structure HeaderEvent {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing shorts and bytes

}
])

apply EventStreamError @eventStreamTests([

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are all client tests, we also need server tests.

travel in the payload of an initial-response event rather than in
HTTP response headers."""
protocol: rpcv2Json
initialResponse: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add forbidHeaders for the headers that shouldn't be here

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should all forbid Content-Length in the initial http request since it's forbidden for streaming operations.

blobEvent: BlobPayloadEvent
}

structure BlobPayloadEvent {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no structure / union eventPayload.

@lucix-aws
lucix-aws changed the base branch from protocol-test-refactor to main October 12, 2026 19:26
@lucix-aws
lucix-aws force-pushed the rpcv2json-protocol-tests branch from 7a3ec4e to dd7a135 Compare October 12, 2026 19:26
@JordonPhillips
JordonPhillips enabled auto-merge (rebase) October 28, 2026 14:40
@JordonPhillips
JordonPhillips merged commit 47ebc08 into smithy-lang:main Oct 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants