Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
So there's tests and the module doesn't seem to be automated them. Here's a patch to move them into PSR-4 autoloading (because 7.36 supports this!) and get automated testing turned on.
Comment | File | Size | Author |
---|---|---|---|
#55 | update_and_fix_the_tests-2481201-55.patch | 2.35 KB | mglaman |
#54 | update_and_fix_the_tests-2481201-54.patch | 9.88 KB | mglaman |
#44 | update_and_fix_the_tests-2481201-44.patch | 343 bytes | joelpittet |
#41 | update_and_fix_the_tests-2481201-41.patch | 3.28 KB | joelpittet |
#38 | commerce_discount_benign.patch | 552 bytes | joelpittet |
Comments
Comment #1
mglamanHere's initial patch to update the tests and get ball rollin'!
Comment #2
joelpittet@mglaman That's cool PSR-4 is supported, I didn't see that issue go in. Any chance you have a reference?
Also, is this what is needed to get automated testing to work and be turned on like you were mentioning on twitter?
Comment #3
mglamanHere's the node about getting PSR-4 support for tests in D7 - #2293767: Allow PSR-4 test classes to be used in D7.
Not a requirement to get it going, but makes it cleaner than large *.test files. This also fixes _usage which had a test but it wasn't declared. I also feel it helps show code coverage and will encourage writing more tests.
Before/after whenever the checkbox over on https://www.drupal.org/node/1650350/qa needs to be enabled.
Comment #4
mglamanAfter discussing in IRC, the move to make tests PSR-4 was too big of a jump :) Need to get things cleaned up first.
Here is a new patch.
Comment #5
joelpittetSee if we can't jar this to unpostponed.
Comment #6
joelpittetComment #8
joelpittet@mglaman thanks I've committed everything except for this part which seems to have an issue when I ran the tests locally and I'm not sure what it's doing at first glance.
Comment #11
joelpittetFixed some exceptions with the json format and turned status back because that's how it exports as.
Comment #14
joelpittetOk that fixes the exceptions...
Discounts date 66 passes, 3 fails, 0 exceptions, and 4 debug messages
Discounts 186 passes, 7 fails, 0 exceptions, and 28 debug messages
Comment #19
joelpittetLet's see if the dependencies are affected by the profile minimal (hope not)
Comment #31
joelpittetI've got a machine that is reproducing the errors. Trying to track down why but the issue is primarily the address field module isn't enabling.
I'll have to dig deeper to sort that out.
Comment #34
joelpittetWell similar but not the same error as testbot. I've commented out the failing tests that I couldn't fix off hand and will uncomment them as I resolve them.
Comment #36
joelpittetThese tests pass locally. Trying something a bit more drastic.
Comment #38
joelpittetMore drastic, committed hiding the submodule tests and added all depenencies to test_dependencies.
Comment #41
joelpittetThis test was the tricky one that was failing.
Comment #43
joelpittetSome tests commented out, need to fix those. I think free_product has problem now.
Feel free help fix them:) or make them better in this issue! I'll commit green uncommented tests;)
Comment #44
joelpittetWill it blend?
Comment #54
mglamanUsage checks for products have been broken, here is patch which fixes them and has passing tests.
Comment #55
mglamanAnother patch to fix last test.
Comment #56
mglamanLinking to build with all of the two patches: https://travis-ci.org/mglaman/commerce_discount-d7-travis/builds/72541592
Comment #58
joelpittetI've committed this change, thanks for spotting that @mglaman
And
And this change was awesome that you found that. There is no free_products for product_discount and it gives one free and doesn't subtract from existing, that may have been legacy functionality.
Comment #61
joelpittetOk abused this issue enough. All the tests pass on Travis, locally on CLI and through the UI.
No more commented out tests! Thanks @mglaman for the help and encouragement.
Comment #64
mglaman;) Test bot got fixed, so it's running queued patches.