Skip to content

Generate client endpoint tests if test cases have operationInputs or otherwise are viable #4073

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 4 commits into from
Jun 8, 2023

Conversation

cenedhryn
Copy link
Contributor

to ignore test cases that lack operationInputs unless explicitly instructed to include them

Motivation and Context

The generated client endpoint tests aim to provide a more comprehensive e2e test coverage for endpoint rules than the tests that target the resolver itself. However, the client level tests require input parameters in order to work (calling an API).
Prior to this change, we always included all test cases in the generated client endpoint tests independently of whether the test case had the operationInput member or not, and manually added test cases that didn't work to the test skip list. When new tests are added, it requires manual intervention and an increased ops load.

With this change, we only generate tests for the test cases with operationInputs, unless an overriding flag is set. The override flag should be used for services where the codegen can find suitable input parameters without relying on operationInputs, such as endpoint prefix enabled services.

Modifications

  • Removes auto-codegen of client tests when operationInput is missing
  • If there are no tests at all, do not generate the class
  • Adds a flag generateEndpointClientTests that overrides the operationInput condition
  • Adds the new flag to the customization.config of 13 services with hostPrefix
  • Removes unnecessary test skips for the 5 services that explicitly excluded tests of the type missing operation input

Testing

The tests for this PR should pass before approval

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Checklist

  • I have read the CONTRIBUTING document
  • Local run of mvn install succeeds
  • My code follows the code style of this project
  • My change requires a change to the Javadoc documentation
  • I have updated the Javadoc documentation accordingly
  • I have added tests to cover my changes
  • All new and existing tests passed
  • I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • I confirm that this pull request can be released under the Apache 2 license

@cenedhryn cenedhryn requested a review from a team as a code owner June 7, 2023 17:09
@cenedhryn cenedhryn enabled auto-merge (squash) June 7, 2023 18:04
@cenedhryn cenedhryn disabled auto-merge June 7, 2023 23:50
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 8, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

51.5% 51.5% Coverage
16.4% 16.4% Duplication

@cenedhryn cenedhryn merged commit 5ce8eb4 into master Jun 8, 2023
@cenedhryn cenedhryn deleted the salande/update-endpoint-client-test-generation branch June 8, 2023 15:10
L-Applin pushed a commit that referenced this pull request Jul 24, 2023
…otherwise are viable (#4073)

* Updating codegen for endpoint client tests to ignore test cases without operationInputs unless explicitly instructed to include them

* Only generate client test spec class if there are any matching test cases
aws-sdk-java-automation added a commit that referenced this pull request Jun 24, 2025
…cb62ac3c5

Pull request: release <- staging/0218c979-0246-4342-b8c9-673cb62ac3c5
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