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

Custom test modules #1337

Open
mattias-p opened this issue Apr 4, 2024 · 1 comment
Open

Custom test modules #1337

mattias-p opened this issue Apr 4, 2024 · 1 comment

Comments

@mattias-p
Copy link
Member

Depends on:

Zonemaster::Engine::Test/run_for_all() needs to know about all the test modules
it should run and in which order to run them. Today it makes this determination
by parsing a file from disk and prepending the built-in Basic test module. To
run an additional test module you need to include it in the file.

This mechanism should be replaced like so:

  • Add a class method to Zonemaster::Engine::Profile that returns the
    Perl package that was provided to the test module registration method.
  • Add a class method to Zonemaster::Engine::Profile that returns the of test
    module names. The list should contain an entry for each registered test
    module. Test modules under 'Zonemaster::Engine::Test::' be ordered before any
    others. Within these two groups, test modules should be listed in the order
    they were registered.
  • Update Zonemaster::Engine::Test/modules() to call the new Profile
    method instead of using the old parse and prepend algorithm.
  • Update the test running methods in Zonemaster::Engine::Test to query the
    Profile module for the ordered set of test module names and their
    corresponding Perl modules.
@mattias-p
Copy link
Member Author

I'm not super-fond of the special handling of modules under 'Zonemaster::Engine::Test::'. The idea is that it should be impossible for 3rd party modules to get loaded before the built-in ones. Perhaps there is a better way to ensure this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant