Skip to content

Add ability to filter tests #360

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

Merged
merged 5 commits into from
Jun 21, 2021

Conversation

JordonPhillips
Copy link
Contributor

@JordonPhillips JordonPhillips commented Jun 21, 2021

This adds the ability to filter certain test cases. Reasons for doing this might include wanting to skip tests for a feature not yet implemented or wanting to skip a test whose asserted http request is only one of several valid options.

smithy-go has something similar, but rather than having a functional interface they have a locked down builder where you must be very explicit on what you want to skip. My motivation for going with the functional interface instead was to address complexity around generating for input/output/error and to allow for more easily skipping based on things in the settings (such as client vs ssdk). I could be convinced to go their way though.

see also: aws/aws-sdk-js-v3#2506

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

This adds the ability to filter certain test cases. Reasons for doing
this might include wanting to skip tests for a feature not yet
implemented or wanting to skip a test whose asserted http request is
only one of several valid options.
@JordonPhillips JordonPhillips requested a review from a team as a code owner June 21, 2021 15:53
@alexforsyth
Copy link
Contributor

Sweet, we need to run a codegen along with this too

@JordonPhillips
Copy link
Contributor Author

Temporarily closing because I realized that ts doesn't have a hook into the protocol test generation like go does

This updates the way protocol tests are generated. Instead of always
generating http protocol tests, it now relies on protocols to
initiate test generation. This is important for non-http protocols.
It's also important for being able to customize the generation for
http protocols.

There is an unfortunate implication - a test file will always be
generated now. This shouldn't *really* matter since that won't be
part of the uploaded artifacts anyway.
Copy link
Contributor

@alexforsyth alexforsyth left a comment

Choose a reason for hiding this comment

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

+1

@JordonPhillips JordonPhillips merged commit 229e2f0 into smithy-lang:main Jun 21, 2021
gosar added a commit to gosar/smithy-typescript that referenced this pull request Jun 22, 2022
Instead of DeferredWriter passes the WriterDelegator along in GenerationContext
so generateProtocolTests can create the file only if any tests need to be
written.

This is alternative to smithy-lang@09b9956
from smithy-lang#360. It is going back to
using writerDelegator like before (and picking the fileName inside the test
generation logic, instead of in DirectedTypeScriptCodegen.
gosar added a commit to gosar/smithy-typescript that referenced this pull request Jul 1, 2022
Instead of DeferredWriter passes the WriterDelegator along in GenerationContext
so generateProtocolTests can create the file only if any tests need to be
written.

This is alternative to smithy-lang@09b9956
from smithy-lang#360. It is going back to
using writerDelegator like before (and picking the fileName inside the test
generation logic, instead of in DirectedTypeScriptCodegen.
gosar added a commit to gosar/smithy-typescript that referenced this pull request Jul 1, 2022
Instead of DeferredWriter passes the WriterDelegator along in GenerationContext
so generateProtocolTests can create the file only if any tests need to be
written.

This is alternative to smithy-lang@09b9956
from smithy-lang#360. It is going back to
using writerDelegator like before (and picking the fileName inside the test
generation logic, instead of in DirectedTypeScriptCodegen.
gosar added a commit that referenced this pull request Jul 1, 2022
Instead of DeferredWriter passes the WriterDelegator along in GenerationContext
so generateProtocolTests can create the file only if any tests need to be
written.

This is alternative to 09b9956
from #360. It is going back to
using writerDelegator like before (and picking the fileName inside the test
generation logic, instead of in DirectedTypeScriptCodegen.
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.

3 participants