Updates unit tests for ZONE09#1215
Conversation
a0dc47d to
778921c
Compare
778921c to
642722d
Compare
marc-vanderwal
left a comment
There was a problem hiding this comment.
Looks good to me.
I like the idea of the test being described by data following the __DATA__ keyword. Though maybe this structured data could be expanded to become some kind of domain-specific language, and become a bit more self-documenting in the process.
I was thinking about a syntax similar to the following:
zone no-response-mx-query.zone09.xa
should give Z09_NO_RESPONSE_MX_QUERY
# and listing message tags that should not appear becomes optional
zone inconsistent-mx.zone09.xa
should give Z09_INCONSISTENT_MX, Z09_MX_FOUND, Z09_NO_MX_FOUND, Z09_MX_DATA
should not give Z09_MISSING_MAIL_TARGET
We might also want to give ourselves a way to continue a list of message tags on multiple lines, in order to avoid excessively long lines.
But my suggestion is better addressed in another PR.
I see pros of your suggestions, but then I think should be keys that stick out more, and could even be abbreviations, and that could permit multiple physical lines for one logical. E.g.
Yes, I think so. This file could be updated when we have found the format. |
|
I’ve spent an afternoon tinkering with a parser for a small language that accepts a syntax like this: Whitespace is optional everywhere and has no syntactic value; in other words, indentation is entirely optional and the only way to terminate a I drew inspiration from the syntax of a |
You do not like my suggestion of e.g.
That would be fine.
I am not sure that is a good idea. Then
If we agree on the syntax, could you implement that in a utility pm file? But that would be for the v2023.2 release, wouldn't it? |
|
Your idea works, and makes for a much simpler parser. However, abbreviations such as I understand your concern with having Anyhow, no attempt at a nicer language for describing these classes of tests will make it for the 2023.1 release. Unless anyone else wishes to look at this PR, I suggest this one be merged as it is. 🙂 |
tgreenx
left a comment
There was a problem hiding this comment.
LGTM. I just have one concern when a Test Case is not tested by the whole module, see #1216 (comment).
This PR does not affect any component based |
See #1216 (comment) |
Purpose
This PR replaces the unit tests for ZONE09 with unit tests and data based on the Test Zone framework proposed in
zonemaster/zonemaster#1151. All tests are described in that PR.
How to test this PR
The unit tests must pass the CI checks.
Review the set-up of the code.