Skip to content
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

Merged
merged 1 commit into from
Apr 3, 2023
Merged

Conversation

heaths
Copy link
Member

@heaths heaths commented Apr 3, 2023

Fixes errors introduced in #35228

@heaths heaths requested review from kristapratico and pallavit April 3, 2023 22:31
@heaths
Copy link
Member Author

heaths commented Apr 3, 2023

/azp run net - cognitivelanguage - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@heaths
Copy link
Member Author

heaths commented Apr 3, 2023

@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.

Copy link
Member

@annelo-msft annelo-msft left a 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?

@heaths
Copy link
Member Author

heaths commented Apr 3, 2023

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 projectName and misplaced the task object one level too deep on another request.

@annelo-msft
Copy link
Member

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 projectName and misplaced the task object one level too deep on another request.

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.

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

@heaths
Copy link
Member Author

heaths commented Apr 3, 2023

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.

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

@heaths heaths enabled auto-merge (squash) April 3, 2023 22:56
@heaths heaths merged commit d8dac31 into Azure:main Apr 3, 2023
@heaths heaths deleted the fix-coglang-tests branch April 3, 2023 23:05
@JoshLove-msft
Copy link
Member

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.

@JoshLove-msft
Copy link
Member

JoshLove-msft commented Apr 4, 2023

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants