zonemaster-engine icon indicating copy to clipboard operation
zonemaster-engine copied to clipboard

Updates TestUtil.pm for unit tests

Open matsduf opened this issue 9 months ago • 1 comments

Purpose

This PR introduces two changes to function in TestUtil.pm:

  • Support of undelegated data (both NS and DS) for unit tests.
  • Makes the function more flexible to avoid long lists of tags when not needed.
  • Do not use diag/fail when there is an error in the t file. Use croak() instead.
  • More verifications of data.

The unit test file t/Test-nameserver15.t has been updated to match the new format.

Context

The update is needed for https://github.com/zonemaster/zonemaster/pull/1255.

How to test this PR

Currently this will break most unit tests that depend on the t/TestUtil.pm. Only t/Test-nameserver15.t has been updated. Please review the code in TestUtil.pm before the other t files are updated.

matsduf avatar May 06 '24 14:05 matsduf

@mattias-p, please re-review.

matsduf avatar May 07 '24 13:05 matsduf

@mattias-p, could your re-review?

matsduf avatar May 13 '24 12:05 matsduf

@tgreenx and @mattias-p, please re-review.

matsduf avatar May 14 '24 12:05 matsduf

@mattias-p, @tgreenx and @marc-vanderwal, can you approve this? I would like to merge it. It updates TestUtils.pm and the unit tests that use it. They pass as expected.

matsduf avatar May 21 '24 07:05 matsduf

I’ve had a look. I see no issues that haven’t already been brought up by @tgreenx.

marc-vanderwal avatar May 21 '24 12:05 marc-vanderwal

@marc-vanderwal and @tgreenx, please re-review after my latest updates.

matsduf avatar May 21 '24 13:05 matsduf

@marc-vanderwal and @tgreenx, please re-review after my latest updates. All tests pass. TestUtil now treats empty-empty as an error. Can this be merged now?

matsduf avatar May 22 '24 07:05 matsduf

I have commited the proposal from @tgreenx and I have updated the documentation so that it states that empty-empty is not permitted. @marc-vanderwal and @tgreenx, please re-review.

matsduf avatar May 22 '24 09:05 matsduf

@marc-vanderwal and @tgreenx, please re-review.

matsduf avatar May 22 '24 09:05 matsduf