-
Notifications
You must be signed in to change notification settings - Fork 63
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
Test for parsing CLI arguments in lfc
#1668
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.
Thanks for taking this on! I will push a couple of changes in the direction of my comments
org.lflang.tests/src/org/lflang/tests/cli/CliToolTestFixture.java
Outdated
Show resolved
Hide resolved
@oowekyala thanks for the changes, it looks much better now! |
@oowekyala just added a small fix to make the test |
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.
This looks pretty good! I left some minor requests for changes. Perhaps beyond the scope of this PR but good to do in the future would be to extend the tests to check the resulting TargetConfig
as well.
lfc
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.
This looks great! Thanks, @patilatharva!
This PR adds a test that tests if the CLI arguments passed into Lfc match the values in the target properties
Properties
object which is passed to the generator. The test only checks that the desired values are passed to the generator and doesn't test the functionality of those values, because I believe that would belong in the LF unit tests and be out of scope for the CLI tests.Rationale: #1641 - The bug fixed in #1631 showed that our current CLI tests are merely smoke tests and not sufficient to detect if arguments are passed properly.
Implementation notes: I preserved the structure of the existing
CliToolTestFixture.java
as much as possible, but chose to test by creating an Lfc object rather than using static methods. It seemed like the simplest way to gain visibility into the instance methods (which are necessary for Picocli), but let me know if there's a better way around this in Java.