-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix some Cognitive Language test errors #35320
Conversation
/azp run net - cognitivelanguage - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
@annelo-msft @KrzysztofCwalina this is a good example of what not having models might lead to. In part, though, it's because we don't validate inputs for our test framework and I had a typo I copied/pasted in several tests. The other issue was that an object was nested one level too deep - all things that models over anonymous types or dynamic types would've prevented. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @heaths, it's a good call-out, and I think a known risk of hand-authoring JSON (i.e. not using compiled model types) using any method.
I'm curious, did these tests pass before? How did you discover the issue?
The recorded tests pass because we don't validate requests - only responses. The live tests failed because I missed an "e" on the end of |
That's good feedback. We may want to recommend in our docs that end-to-end testing is a best practice to avoid this kind of error. I'll make a note on the docs PR. |
API change check API changes are not detected in this pull request. |
We don't currently recommend they have end-to-end testing? Or do you mean that they run live tests prior to submitting initial tests? To record they would've had to. This is a case where we don't check the request like we do the responses. Perhaps we could by recording our own byte count for a quick test and drill into body matching for requests. /cc @JoshLove-msft @christothes |
Can you clarify why we are not matching requests here? Is it because it is disabled for this specific library? Request body matching is on by default. |
Ah we disabled body comparisons because of the old "doubles mismatch on different runtimes" issue. Here is the recommended workaround - we should probably add this to the Test Framework docs. If only someone had an issue assigned to them instructing that they do this 😆 (that would be me) |
Fixes errors introduced in #35228