-
Notifications
You must be signed in to change notification settings - Fork 15
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
Log PROCESS_INSTANCE_CREATION records with start instructions #434
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 the change Nico! Overall it looks good but there are some excessive commas being logged which shouldn’t be there.
Please also have a look at the ci, it is failing because the dependency you’ve introduced is not used.
filters/src/test/java/io/camunda/zeebe/process/test/filters/logger/RecordStreamLoggerTest.java
Outdated
Show resolved
Hide resolved
filters/src/test/java/io/camunda/zeebe/process/test/filters/logger/RecordStreamLoggerTest.java
Outdated
Show resolved
Hide resolved
90c4e04
to
ef24358
Compare
The logRecords method could never be used to test because it only has side effects (printing to log), but internally it works by building up a String with a StringBuilder. By extracting this string building into a separate method, its easy to test the produced String that will be logged.
The logStartInstructions is a direct copy of the CompactRecordLogger implementation in Zeebe, with 1 exception: - removed the spaces around the resulting string to fit better into the result
Uses the ImmutableRecord builder to create a record, stringify the record for logging and then asserts the resulting string. I've chosen to test 2 cases: no instructions, 2 instructions. 1 instruction would be an untested edge case, but it doesn't really matter IMO.
By using a parameterized test, its easier to expand the tests. Simply add another Argument with a record and what the log should contain.
These commas look strange in the printed logs. They shouldn't be necessary
This time for jobs.
ccee8d4
to
723fe0e
Compare
@remcowesterhoud, I've made the requested change. I feel like the error logging is a very important part of ZPT, and we should probably focus on improving the test coverage of this logging. That's why I've gone back and tried to improve the tests that I originally added. It should now be easier to expand them for other records. I've also applied the comma fix for Job record logging, but I haven't changed it for all records. I don't want to mess too much with it without having tests in place. We should consider making that a bigger issue |
@remcowesterhoud Would be cool to get this merged before creating |
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.
Sorry for taking so long to review, thanks for the fix @korthout 🏆
Description
Expands the RecordLogger to also log the start instructions of
PROCESS_INSTANCE_CREATION
records.Also adds easier testing to the RecordStreamLoggerTest.
Related issues
closes #411
Definition of Done
Not all items need to be done depending on the issue and the pull request.
Code changes:
Testing:
Documentation: