-
Notifications
You must be signed in to change notification settings - Fork 31
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
RML output & testing #15
Comments
I was thinking about simply checking if the resulting PDF is identical to a "known good" version. I.e. a functional test, not a unit test. In my experience, this works well for regression tests. We could use the RML format instead of PDF for this as the diffs should be more readable. Mocking can work for unit tests, but sometimes it's not worth it because how it adds complexity to the code. |
I think I have a way of doing this which preserves all of the intricate usage of Platypus that you had originally coded- but outputs RML, which reportlab then imports. IMO the added complexity of using RML is a net gain in terms of being able to manipulate and test the |
Well @vilcans (though please feel free to check out the branch i cut featuring some RML exporting) unfortunately by project has ground to what appears to be a permanent block. Please confirm or challenge my assumptions:
|
I want to avoid adding complexity to the project, so if converting from RML to PDF is brittle or requires new dependencies, I think it's better to keep the current behavior of outputting PDF directly. For testing PDF output, what do you think about simply adding PDF test cases? If such a test fails, the diff will probably be hard to read, but if you just open the failed document in a PDF reader, you can easily see what (if any) the regression is. |
I agree. The RML approach is too brittle, and it's a totally separate dependency that adds a lot of complexity to the project. I will close this ticket, and focus on PDF tests. |
My favorite idea so far is mocking out some part of ReportLab such that it exports its RML to a spy.
Otherwise perhaps just mocking out ReportLab entirely.
The text was updated successfully, but these errors were encountered: