-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make test module auto-detection less dynamic #580
Conversation
This is makes us resilient to situations where Z::E was updated but the old verision was not properly cleaned up. It really helps on buggy SaaS CI platforms where we don't have full control over the machines being used.
e2fc3f4
to
fa20218
Compare
map { my $f = $_; $f =~ s|^Zonemaster::Engine::Test::||; $f } | ||
grep { $_ ne 'Zonemaster::Engine::Test::Basic' } useall( 'Zonemaster::Engine::Test' ); | ||
BEGIN { | ||
@all_test_modules = split /\n/, read_file( dist_file( 'Zonemaster-Engine', 'modules.txt' ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really the best solution? Isn't better to create a perl module that lists the modules? I feel that the code would be simpler and more direct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just want to fix a bug here. As such I'm trying to change the design as little as possible.
Feel free to create an issue to make the module listing completely static.
@vlevigneron to review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I approve even if I'm not sure to understand all consequences (if any).
This should fix a problem with Travis failing for zonemaster-backend.
The problem caused by Travis installing a newer version of Z::E being on top of an older version without properly cleaning up older version. A module named Z::E::Test::Example existed in the older version but was removed in the newer one. In addition to this there was an API change causing the old version of Z::E::Test::Example to be incompatible with the new version of Z::E.
The problem is solved by auto-detecting the Z::E::Test modules once and for all at configure-time instead of looking for any modules under the Z::E::Test namespace at run-time.
As a drive-by fix I also added to remove the necessity to install Z::E in @inc in development mode.