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 CI for 1.44.0 bump #142

Merged
merged 1 commit into from
Feb 7, 2024
Merged

Conversation

milesziemer
Copy link
Contributor

A test depended on the ordering of validation events, which 1.44.0 changes.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

A test depended on the ordering of validation events, which 1.44.0 changes.
@milesziemer milesziemer requested a review from a team as a code owner February 7, 2024 20:47
String expectedMessage = "Proto index 1 is used muliple times in members name," +
"age of shape (structure: `some.test#MyStruct`).";
Optional<ValidationEvent> matchingEvent = validationEvents.stream()
.filter(ev ->ev.getMessage().equals(expectedMessage)).findFirst();

Choose a reason for hiding this comment

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

nit: I think you could a hamcrest matcher (or orElseThrow) to make this a little cleaner

assertThat(validationEvents, hasItem(hasProperty("message", equals(expectedMessage)))

or

.orElseThrow(() -> new AssertionError(...))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would if we used hamcrest in the language server. Will be adding it in the future though.

validationEvents.get(0).getMessage()
);

String expectedMessage = "Proto index 1 is used muliple times in members name," +
Copy link

Choose a reason for hiding this comment

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

Nit, there is a typo on "muliple" and a missing white space after the comma.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, that's just the message the validator produces, which lives in a jar in test resources. I don't remember where exactly it came from

@milesziemer milesziemer merged commit b43f9c3 into smithy-lang:main Feb 7, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants