-
Notifications
You must be signed in to change notification settings - Fork 2
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
added robot init unit test #6
base: main
Are you sure you want to change the base?
Conversation
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.
LGTM!
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.
Unclear this is useful yet and expect it's in progress. Some notes though.
src/test/java/frc/InitTests.java
Outdated
} | ||
|
||
@Test | ||
private void initTest() { |
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.
Prefer test names that say what is expected. These are never called, so you should be excessively verbose since it's what's going to communicate intent when it fails. F.e, "robotShouldNotCombustWhenFedFrechfries()" would be a totally reasonable unit test method name.
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.
Also note you don't event need test in the name - you've already communicated it's a test with the annotation
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.
All that being said, what's your goal with this method? When does it fail? What does it tell you when it does?
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.
the goal here is just to make sure Robot
initializes without throwing an error, mainly as a simple template for unit tests as we (hopefully) add more throughout the season
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.
Then I'd make it explicit with a assertDoesNotThrow. Communicates your intent and makes clear you didn't forget the assert along the way.
@@ -26,5 +26,6 @@ | |||
}, | |||
], | |||
"java.test.defaultConfig": "WPIlibUnitTests", | |||
"java.compile.nullAnalysis.mode": "automatic" | |||
"java.compile.nullAnalysis.mode": "automatic", | |||
"wpilib.skipTests": true |
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.
Is this set to true on purpose?
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.
yes, to avoid excessive delays during deploys from running unit tests, and instead my plan was to run these tests in ci
No description provided.