Skip to content

Massage S3 test bucket name to avoid underscores #2893

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

Closed
wants to merge 3 commits into from

Conversation

ybuzko
Copy link

@ybuzko ybuzko commented Dec 7, 2021

Massage S3 test bucket name to avoid underscores

Motivation and Context

In S3BucketUtils, there is a helper function temporaryBucketName that produces a temporary bucket name for unit and integration tests. It uses system username as part of the concatenation. In some OS (Windows, maybe others), underscore is an allowed character (in fact, Windows 10 auto-creates usernames with underscores in the middle). S3 bucket names do not allow underscores. Thus, any S3 unit tests fail on Windows.

Description

Adding a call to replace underscores with dashes in the username component of the generated bucket name.

Testing

  1. Executed a unit test that includes a call to temporaryBucketName(), and subsequent creation of a test S3 bucket with that name, on Windows 10. It failed due to my username having an underscore.
  2. Made the change.
  3. Re-ran the test. Bucket creation succeeded.

Screenshots (if appropriate)

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 read the README document
  • I have added tests to cover my changes
  • All new and existing tests passed
  • A short description of the change has been added to the CHANGELOG
  • 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

@ybuzko ybuzko requested a review from a team as a code owner December 7, 2021 08:08
@sonarqubecloud
Copy link

sonarqubecloud bot commented Dec 7, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@ybuzko ybuzko closed this Dec 9, 2021
aws-sdk-java-automation added a commit that referenced this pull request Feb 8, 2024
…9f93cd5d9

Pull request: release <- staging/e358ef45-7969-4222-a98d-7fc9f93cd5d9
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.

1 participant