HDDS-14197. Add utility for generating unique object name in tests#9517
HDDS-14197. Add utility for generating unique object name in tests#9517adoroszlai merged 1 commit intoapache:masterfrom
Conversation
devmadhuu
left a comment
There was a problem hiding this comment.
Thanks @adoroszlai for the patch. This is good change and generic. So are we planning to change and use this across all test code in ozone wherever we are creating volumes, buckets etc ?
|
@adoroszlai thanks for the patch ! |
| private String getBucketName(String suffix) { | ||
| return ("v1-" + getTestName() + "bucket" + suffix).toLowerCase(Locale.ROOT); | ||
| private String getBucketName(String ignored) { | ||
| return uniqueObjectName(); |
There was a problem hiding this comment.
Should we have "v1-" / "v2-" prefixes still ?
There was a problem hiding this comment.
Actually, I don't really know about the difference between v1 and v2.
There was a problem hiding this comment.
v1/v2 prefix was added in HDDS-14191 only to make the names unique across the two tests.
| private String getBucketName(String suffix) { | ||
| return ("v2-" + getTestName() + "bucket" + suffix).toLowerCase(Locale.ROOT); | ||
| private String getBucketName(String ignored) { | ||
| return uniqueObjectName(); |
+1 to this question. |
I don't plan to update all test code just for this. But whenever we add new or change existing tests, this can be used to simplify a bit. |
|
Thanks @devmadhuu, @rich7420, @sarvekshayr for the review. |
|
thanks @adoroszlai ! |
What changes were proposed in this pull request?
Provide a method that tests can use to generate unique names for objects (volumes, buckets, keys, etc.).
https://issues.apache.org/jira/browse/HDDS-14197
How was this patch tested?
CI:
https://github.com/adoroszlai/ozone/actions/runs/20300605053