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

Improved test coverage #386

Merged
merged 8 commits into from
Oct 14, 2024
Merged

Conversation

mattias-p
Copy link
Member

Purpose

Scope

This PR concerns itself with validation and dispatching of user-provided command line options to zonemaster-cli.

Limitations:

  • The actual implementations of the options are only within scope here to the extent that proper dispatching can be determined. Any other problems with option implementations are deferred to separate issues.
  • Details in how command line arguments are parsed are out of scope.
  • The --progress option is out of scope.

Goal

This PR aims to establish a sufficient regression testing suite for the stated scope. It would be great if we didn't need to perform any manual testing for this particular aspect of the application when switching out the command line parsing library.

Context

As part of #68 we plan to drop our dependency on Moose and MooseX::Getopt::GLD. That will affect every command line option in zonemaster-cli.

Changes

Fixes the handling of invalid --hints argument.

New tests are added for options and option combinations:

  • --restore
  • --save
  • --json-translate
  • --encoding
  • --count --raw
  • --count --json
  • --count --json-stream
  • --elapsed --raw
  • --elapsed --json
  • --elapsed --json-stream
  • --nstimes --raw
  • --nstimes --json
  • --nstimes --json-stream
  • Underscore option aliases

To help finding gaps in test coverage I added support for Devel::Cover in usage.t.

This PR also includes some cleanups.

How to test this PR

Unit test should pass.

Special considerations when reviewing this PR

  1. Are there any options or combinations that deserve automatic tests but doesn't have any?
  2. Do any options or combinations deserve more thorough automatic tests?

@mattias-p mattias-p added the V-Patch Versioning: The change gives an update of patch in version. label Oct 9, 2024
@mattias-p mattias-p added this to the v2024.2 milestone Oct 9, 2024
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 see no issues with this. Nice to get better test coverage.

@mattias-p mattias-p merged commit a4750c7 into zonemaster:develop Oct 14, 2024
1 check passed
@mattias-p mattias-p deleted the test-coverage branch November 25, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V-Patch Versioning: The change gives an update of patch in version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants