I've disabled for the time being the automated testing of issue queue because we need to rewrite the tests. Discount, Discount usage & Discount date need to be rewrote/updated.

Comments

jkuma’s picture

Status: Active » Needs work
jkuma’s picture

Priority: Major » Critical
vasike’s picture

Priority: Critical » Major
Status: Needs work » Needs review
StatusFileSize
new13.14 KB

here is a first work on rewriting the discount tests.
any feedback it's welcomed.

- Added Discount component price name (component_title) to tests.
- Added Edit and Delete UI test for commerce_discount.test

to do:
- Add Edit and Delete UI tests for commerce_discount_date, commerce_discount_usage - are they necessary???
- Add the new Discount types to tests.
- others ???

pcambra’s picture

Looking great so far

to do:
- Add Edit and Delete UI tests for commerce_discount_date, commerce_discount_usage - are they necessary???

Yes but they probably should live in the submodules.

- others ???

At least two areas more: install/uninstall/enable/disable discount tests (fields are created/deleted properly) and the actual effect of the discount, i.e. creating a 20% off with and without some inline conditions actually discounts that 20%, also the new discount types should be tested as you well mention.

My call to this issue would be not to wait until have it all but committing incrementally new tests, either keeping one issue or having separated ones.

vasike’s picture

StatusFileSize
new19.44 KB

@pcambra : thanks a lot for the feedback and i agree with you.
i also think we can commit the test patches and put the task on "needs work" state, specifying the (remained) todos.

here is a new patch which adds to previous:
- Edit UI tests for commerce_discount_date, commerce_discount_usage, Delete UI not needed (the same as for commerce_discount)
- Test for Free products Discount type.

todos:
- Free shipping Discounts test: is this needed? this Discount could be built only if we have Commerce Shipping installed
- Discount with Inline Condition test : which Inline Condition should be tested here?
- install/uninstall/enable/disable discount tests (fields are created/deleted properly)

joelpittet’s picture

Issue summary: View changes
Issue tags: +Needs reroll

Thank you for cleaning up and adding moar tests!

Does this resolve these strict errors as well?

Strict warning: Declaration of CommerceDiscountDateTest::setUp() should be compatible with CommerceDiscountTestBase::setUp($sub_module = false) in _registry_check_code() (line 3186 of includes/bootstrap.inc).
Strict warning: Declaration of CommerceDiscountDateTest::createDiscount() should be compatible with CommerceDiscountTestBase::createDiscount($discount_type, $offer_type, $amount, $name = '') in _registry_check_code() (line 3186 of includes/bootstrap.inc).

It needs a re-roll.

patching file commerce_discount.test
Hunk #2 FAILED at 91.
Hunk #3 succeeded at 183 with fuzz 1.
Hunk #6 FAILED at 215.
Hunk #8 FAILED at 348.
3 out of 9 hunks FAILED -- saving rejects to file commerce_discount.test.rej
patching file modules/commerce_discount_date/commerce_discount_date.test
patching file modules/commerce_discount_usage/commerce_discount_usage.test
bojanz’s picture

Status: Needs review » Needs work
joelpittet’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new19.24 KB

I've re-rolled this to see how testbot reacts.

Status: Needs review » Needs work

The last submitted patch, 8: refactor_the_discount-2035549-8.patch, failed testing.

joelpittet’s picture

Serves me right... I committed other test related patches before this.

  • joelpittet committed add6b0c on 7.x-1.x
    Issue #2035549 by vasike, joelpittet: Refactor the discount tests
    
joelpittet’s picture

Status: Needs work » Fixed

I've committed these and working on fixing the broken tests which seem to work when I test them manually with.

Working on the remaining failures here:
#2481201: Update and fix the tests!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.