added a test helper to test each type for having the expected default operations.#4627
Conversation
|
Thank you for your contribution @jnyfah! We will review the pull request and get back to you soon. |
|
@antkmsft Thank you for your help in clarifying this issue for me I have added a test helper class that checks for the expected default operations for each type, but I'm not sure if I have placed the helper class in the right location and I am also running into some issues with the clang compiler. Specifically, I'm getting undefined reference errors for the type traits. Could you take a look and let me know if you have any suggestions? Thanks ! |
There was a problem hiding this comment.
Changes look good to me, thanks for the contribution.
Btw, the breadth of compilers we deal with makes most PRs challenging, I'll take a quick peek to see if I can figure out what's going wrong.
ETA: I suspect that the problem may be that the Args template parameter pack may be interfering with the template definition for is_assignable.
// Check if T is assignable from U
template<typename U>
static constexpr bool is_assignable = std::is_assignable<T&, U>::value;I'm not 100% sure about this, but based on my experience MSVC tends to be a lot more permissive than other compilers.
antkmsft
left a comment
There was a problem hiding this comment.
Thank you @jnyfah for your contribution!
This looks pretty solid. I'd love to see our SDK types covered by these tests.
How many types are you planning to cover?
In its current state, when CI succeeds, it is pretty good already as an example to copy-paste and multiply for the rest of the types, so it is up to you where you want to make a break or a stop. But even if it goes in just for the ETag type, it is atomic and it would leave our repo in a consistent state, and definitely in a better state than it was before.
The only thing we'd need to fix now is the failure of these tests:
146 - azure-core.Etag.Assignable (Failed)
147 - azure-core.Etag.Constructible (Failed)
148 - azure-core.Etag.CopyAndMoveConstructible (Failed)
149 - azure-core.Etag.CopyAndMoveAssignable (Failed)
150 - azure-core.Etag.Destructible (Failed)
I haven't looked deeply, but it looks like there is a problem with the method that we currently use to detect Destructible, for example, because I don't think ETags are not destructible, so there seems some disconnect there.
|
Thanks @LarryOsterman, figured it out, it was |
|
@antkmsft, fixed the tests it looks like there's another person showing interest in working on this as well. I don't want to hog all the fun by myself 🙂, so I think it would be great if we could collaborate. I would love to start with the |
* Remove -Login and -PushImages parameters from stress helper (#4615) * Add Azure OpenAI (#4644) Co-authored-by: Shawn Fang <45607042+mssfang@users.noreply.github.com> * move the cleanup config to -SaveInputs parameter on the cli (#4646) Co-authored-by: m-nash <prognash@gmail.com> * Fixes for uploading proxy logs (#4652) Co-authored-by: Bill Wert <billwert@microsoft.com> * Handle docker hangs and subscription mismatch on acr login (#4653) Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> * Sync eng/common directory with azure-sdk-tools for PR 6202 (#4651) * Adding initial commit of TypeSpecE2E common script * add TODO comment * Updated per feedback --------- Co-authored-by: raychen <raychen@microsoft.com> * added a test helper to test each type for having the expected default operations. (#4627) * add test helper * constructible from Args * restucture ClassTraits to ensure portability of static constexpr * fix Etags tests and format * clang format * Add DefaultAzureCredential auth flow diagram (#4654) * Add DefaultAzureCredential auth flow diagram * Update cspell.json --------- Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * Remove defunct template (#4659) Co-authored-by: James Suplizio <jasupliz@microsoft.com> * Convert most AMQP types to read-only; Significant API surface cleanup. (#4640) * Prep for readonly connection * Added options for Connection and Session to enable read-only configuration * Read-only connection and session objects; use message source and target for message sender and receiver * Enabled read-only session; added tests for incorrect AMQPS port * Added token reader sample; flushed out eventhubs properties sample, added some timeouts to send async test * Moved AMQP samples to internal * Moved samples to use GetEnvHelper --------- Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> * Define a standardized header ordering for Azure SDK for C++ (#4632) * Standardized header ordering for C++ repo * Reordered categories to move private headers above public headers; added space between categories to enable future flexibility * fix flaky storage testcase (#4660) --------- Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com> Co-authored-by: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Co-authored-by: Shawn Fang <45607042+mssfang@users.noreply.github.com> Co-authored-by: m-nash <prognash@gmail.com> Co-authored-by: Bill Wert <billwert@microsoft.com> Co-authored-by: raychen <raychen@microsoft.com> Co-authored-by: Jennifer Chukwu <jnyfaah@gmail.com> Co-authored-by: Scott Addie <10702007+scottaddie@users.noreply.github.com> Co-authored-by: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Co-authored-by: James Suplizio <jasupliz@microsoft.com> Co-authored-by: Larry Osterman <LarryOsterman@users.noreply.github.com> Co-authored-by: JinmingHu <jinmhu@microsoft.com>
Pull Request Checklist
Please leverage this checklist as a reminder to address commonly occurring feedback when submitting a pull request to make sure your PR can be reviewed quickly:
See the detailed list in the contributing guide.