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 the build issue in core-lro testing #29707

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MaryGao
Copy link
Contributor

@MaryGao MaryGao commented May 15, 2024

fixes #29634

@MaryGao MaryGao changed the title Update the test cases Fix the build issue in core-lro testing May 15, 2024
@MaryGao MaryGao marked this pull request as ready for review May 15, 2024 14:26
@MaryGao MaryGao requested a review from jeremymeng May 15, 2024 14:28
@@ -2255,15 +2255,16 @@ matrix(
},
});
assert.equal(serialized, expectedSerialized);
assert.equal(poller.operationState.status, "succeeded");
assert.isNotNull(poller.operationState);
assert.equal(poller.operationState!.status, "succeeded");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremymeng Is it possible we could report this error during dev-tool run test:vitest ...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It reports them as warnings already just not failing the tests. We could potentially have some additional step to type-check tests and samples-dev code. I will think about this.

@maorleger @mpodwysocki I remember there's some vitest assertion that could allow us to get rid of the !? assert.exists or something similar?

@azure-sdk
Copy link
Collaborator

API change check

API changes are not detected in this pull request.

Comment on lines +2258 to +2259
assert.isNotNull(poller.operationState);
assert.equal(poller.operationState!.status, "succeeded");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the issue now. assert.isUndefined() above makes the compiler to infer the type as undefined. And the later assertion won't help any more when operating on undefined type.

I think assert.exists() is still better? as isNotNull asserts that the value is not null.

Suggested change
assert.isNotNull(poller.operationState);
assert.equal(poller.operationState!.status, "succeeded");
assert.exists(poller.operationState);
assert.equal(poller.operationState.status, "succeeded");

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.

[test] core-lro tests compilation errors
3 participants