-
-
Notifications
You must be signed in to change notification settings - Fork 266
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
[GSK-1508] Add unit tests for WebSocket-based ML Worker communication (python) #1277
Conversation
Please add the 'safe for build' label in order to perform the sonar analysis! |
backend/src/test/java/ai/giskard/ml/MLWorkerReplyAggregatorTest.java
Outdated
Show resolved
Hide resolved
backend/src/test/java/ai/giskard/config/WebSocketChannelInterceptorTest.java
Outdated
Show resolved
Hide resolved
@Inokinoki could you check the comments and refresh this PR please? |
This comment was marked as outdated.
This comment was marked as outdated.
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.
General comment: Can you reduce code duplication in tests? It makes them harder to maintain in the future.
To have an inspiration about how tests could be structured you can refer to Uncle Bob's "Clean Code" that gives a few good advice:
https://blog.cleancoder.com/uncle-bob/2013/09/23/Test-first.html
the main points are:
- test code quality criterias shouldn't be different from production code (duplication isn't appreciated in either of them)
- tests should be small and focused
@Googleton I also created a bunch of tests for DTOs in push feature. Could you please review them and tell me if I understand well? |
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.
I feel like you made too many tests :p
What I mean is the following : tests are done to ensure our code is functioning
Adding one test to make sure some lib is properly working is fine, but extensively testing validation for every pydantic object is too much : we have to assume that the libs we use are working as expected.
1636e35
to
5adda4f
Compare
c5373ed
to
20ba20d
Compare
57fe93d
to
c90696c
Compare
c90696c
to
e80ca29
Compare
Thanks very much for greatly improving this PR @Hartorn ! |
5dabeb5
to
1471b38
Compare
f709d1d
to
3bed1e1
Compare
(Squashed commits of @Inokinoki) Contributes to #GSK-1508
3bed1e1
to
0402fc7
Compare
Kudos, SonarCloud Quality Gate passed! |
Description
Related Issue
Type of Change
Checklist
CODE_OF_CONDUCT.md
document.CONTRIBUTING.md
guide.make codestyle
.