Skip to content
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

Add testcase results #1055

Merged
merged 6 commits into from
Nov 24, 2022
Merged

Conversation

hannaeko
Copy link
Member

@hannaeko hannaeko commented Oct 12, 2022

Purpose

Make test case available in test result.

Context

Related PR: zonemaster/zonemaster-gui#341
Depends on: zonemaster/zonemaster-engine#1144

Changes

  • Add a testcase field in the object of the results array containing test case ids.
  • Add a testcase_descriptions to map test case ids to the translated test case descriptions.

How to test this PR

% ./script/zmb --server http://127.0.0.1:5000 get_test_results --test-id <testid> --lang en | jq .result.testcase_descriptions
{
  "ZONE08": "MX is not an alias",
  "SYNTAX05": "Misuse of '@' character in the SOA RNAME field",
  "NAMESERVER06": "NS can be resolved",
  "DELEGATION03": "No truncation of referrals",
  "SYNTAX06": "No illegal characters in the SOA RNAME field",
  "CONSISTENCY03": "SOA timers consistency",
  "DNSSEC15": "Existence of CDS and CDNSKEY",
  "DELEGATION01": "Minimum number of name servers",
  "DELEGATION04": "Name server is authoritative",
  // ...
}

@hannaeko hannaeko changed the base branch from master to develop October 12, 2022 16:35
@hannaeko hannaeko marked this pull request as draft October 12, 2022 16:35
Copy link
Contributor

@marc-vanderwal marc-vanderwal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@matsduf
Copy link
Contributor

matsduf commented Oct 27, 2022

Looks fine.

Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created an update to zonemaster/zonemaster-engine#1144 with translated test case descriptions. It works to get the them translated in GUI and in zmb, but there is some coding issue. The PO file is in UTF-8, but when the descriptions are presented they are taken to be some 8 bit character set and character encoding:

zmb --server http://127.0.0.1:5000 get_test_results --test-id 452b0009a1322298 --lang sv | jq
(...)
      {
        "testcase": "ADDRESS02",
        "message": "Bakåtuppslagning (PTR) finns för varje namnserveradress.\n",
        "level": "INFO",
        "module": "ADDRESS"
      },
(...)
      "ADDRESS02": "Bakåtuppslagning (PTR) finns för varje namnserveradress.",
(...)

In the PO file the msgid for both the message and the test case description are identical. Note the corrupted "å" and "ö".

@matsduf
Copy link
Contributor

matsduf commented Oct 28, 2022

API.pm should also be updated.

@matsduf matsduf added the V-Minor Versioning: The change gives an update of minor in version. label Oct 28, 2022
@hannaeko
Copy link
Member Author

It works to get the them translated in GUI and in zmb, but there is some coding issue.

Oh I'll look into it, thanks for having tested that.

API.pm should also be updated.

Documentation is planned.

@matsduf matsduf added this to the v2022.2 milestone Nov 15, 2022
@hannaeko
Copy link
Member Author

It works to get the them translated in GUI and in zmb, but there is some coding issue.

This is fixed.

@hannaeko hannaeko force-pushed the add-testcase-results branch from 3e0cc4d to c7fbe68 Compare November 21, 2022 10:38
@hannaeko
Copy link
Member Author

API.pm should also be updated.

done.

docs/API.md Outdated Show resolved Hide resolved
docs/API.md Outdated Show resolved Hide resolved
@matsduf
Copy link
Contributor

matsduf commented Nov 22, 2022

@blacksponge, is this PR still a draft?

@hannaeko hannaeko marked this pull request as ready for review November 22, 2022 10:10
@hannaeko
Copy link
Member Author

is this PR still a draft?

No I marked it ready for review.

Copy link
Contributor

@matsduf matsduf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just two minor comments, else ready to approve.

docs/API.md Outdated Show resolved Hide resolved
docs/API.md Outdated Show resolved Hide resolved
Copy link
Contributor

@tgreenx tgreenx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hannaeko hannaeko merged commit c2b0df8 into zonemaster:develop Nov 24, 2022
@matsduf matsduf added the S-ReleaseTested Status: The PR has been successfully tested in release testing label Dec 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-ReleaseTested Status: The PR has been successfully tested in release testing V-Minor Versioning: The change gives an update of minor in version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants