Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mglaman’s picture

Status: Active » Needs review
FileSize
68.34 KB

Here's initial patch to update the tests and get ball rollin'!

joelpittet’s picture

@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?

mglaman’s picture

Here'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.

mglaman’s picture

FileSize
5.61 KB

After 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.

  • Fixed Usage submodule not including test
  • Fixes strict warning due to setUp() parameters
  • Fixes import/export test.
joelpittet’s picture

Status: Needs review » Needs work

See if we can't jar this to unpostponed.

joelpittet’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 4: update_and_fix_the_tests-2481201-4.patch, failed testing.

joelpittet’s picture

@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.

  • joelpittet committed bee190b on 7.x-1.x
    Issue #2481201 by mglaman, joelpittet: Update and fix the tests!
    

  • joelpittet committed d6da4b3 on 7.x-1.x
    Issue #2481201 by mglaman, joelpittet: Update and fix the tests!...
joelpittet’s picture

Status: Needs work » Needs review
FileSize
707 bytes

Fixed some exceptions with the json format and turned status back because that's how it exports as.

  • joelpittet committed 56b6b75 on 7.x-1.x
    Issue #2481201 by joelpittet, mglaman: Update and fix the tests!
    

Status: Needs review » Needs work

The last submitted patch, 11: update_and_fix_the_tests-2481201-11.patch, failed testing.

joelpittet’s picture

Ok 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

Fail      Other      commerce_discount   68 CommerceDiscountDateTest->testDisco
    Start date is shown
Fail      Other      commerce_discount   69 CommerceDiscountDateTest->testDisco
    End date is shown
Fail      Other      commerce_discount   87 CommerceDiscountDateTest->testDisco
    Order discount is deducted when in time frame.
Fail      Other      commerce_discount  266 CommerceDiscountTest->testCommerceD
    Exported discount is identical to its origin.
Fail      Other      commerce_discount  282 CommerceDiscountTest->testCommerceD
Fail      Other      commerce_discount  307 CommerceDiscountTest->testCommerceD
    Percentage order discount is deducted correctly.
Fail      Other      commerce_discount  403 CommerceDiscountTest->testCommerceD
    2 discounts are listed as applied on the order.
Fail      Other      commerce_discount  404 CommerceDiscountTest->testCommerceD
    Two fixed order discounts are applied on the total price.
Fail      Other      commerce_discount  405 CommerceDiscountTest->testCommerceD
    An order with one product and two fixed order discounts has three line
    items.
Fail      Other      commerce_discount  407 CommerceDiscountTest->testCommerceD
    After updating the order it still has three line items.

  • joelpittet committed d998778 on 7.x-1.x
    Issue #2481201 by joelpittet: Put rdf_mappings back because they are...

  • joelpittet committed ef32be1 on 7.x-1.x
    Issue #2481201 by joelpittet: Fix strict errors on createDiscount
    

  • joelpittet committed a7815e4 on 7.x-1.x
    Issue #2481201 by joelpittet: Set to minimal for faster tests, removes...
  • joelpittet committed c962a6c on 7.x-1.x
    Issue #2481201 by joelpittet: Fix the broken commerce order tests...

  • joelpittet committed d6d62af on 7.x-1.x
    Issue #2481201 by joelpittet: Fix a couple more tests and comment out...
joelpittet’s picture

Status: Needs work » Needs review
FileSize
728 bytes

Let's see if the dependencies are affected by the profile minimal (hope not)

Status: Needs review » Needs work

The last submitted patch, 19: update_and_fix_the_tests-2481201-19.patch, failed testing.

  • joelpittet committed cc2b261 on 7.x-1.x
    Issue #2481201 by joelpittet: Fix renamed field in tests from...

  • joelpittet committed 1a09dd5 on 7.x-1.x
    Revert "Issue #2481201 by joelpittet: Fix renamed field in tests from...

  • joelpittet committed 7677d2f on 7.x-1.x
    Issue #2481201 by joelpittet: Fix renamed field in tests from...

  • joelpittet committed eaf9f93 on 7.x-1.x
    Issue #2481201 by joelpittet: Fix renamed field in tests from...

  • joelpittet committed 8bfaa03 on 7.x-1.x
    Issue #2481201 by joelpittet: Fixed some more order discounts by...

  • joelpittet committed 53a830b on 7.x-1.x
    Issue #2481201 by joelpittet: Adding setUp back and update docblock
    

  • joelpittet committed 294eae2 on 7.x-1.x
    Issue #2481201 by joelpittet: Update docblock
    

  • joelpittet committed c60d0f3 on 7.x-1.x
    Issue #2481201 by joelpittet: Fix usage extending wrong class and using...

  • joelpittet committed 3bfd4e3 on 7.x-1.x
    Issue #2481201 by joelpittet: Fix usage by adding refresh for the order...

Status: Needs work » Needs review
joelpittet’s picture

I'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.

  • joelpittet committed 0964c69 on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests!
    

Status: Needs review » Needs work

The last submitted patch, 19: update_and_fix_the_tests-2481201-19.patch, failed testing.

joelpittet’s picture

Well 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.

The last submitted patch, 19: update_and_fix_the_tests-2481201-19.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
875 bytes

These tests pass locally. Trying something a bit more drastic.

Status: Needs review » Needs work

The last submitted patch, 36: update_and_fix_the_tests-2481201-36.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
552 bytes

More drastic, committed hiding the submodule tests and added all depenencies to test_dependencies.

Status: Needs review » Needs work

The last submitted patch, 38: commerce_discount_benign.patch, failed testing.

The last submitted patch, 8: update_and_fix_the_tests-2481201-8.patch, failed testing.

joelpittet’s picture

Status: Needs work » Needs review
FileSize
3.28 KB

This test was the tricky one that was failing.

  • joelpittet committed 7a78225 on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests!
    
joelpittet’s picture

Some 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;)

joelpittet’s picture

Will it blend?

Status: Needs review » Needs work

The last submitted patch, 44: update_and_fix_the_tests-2481201-44.patch, failed testing.

  • joelpittet committed 4c54c3c on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests!
    

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, 44: update_and_fix_the_tests-2481201-44.patch, failed testing.

  • joelpittet committed 5779cef on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests!
    

  • joelpittet committed 5f6d84d on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests!
    

  • joelpittet committed eab2310 on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests!
    

  • joelpittet committed 244d670 on 7.x-1.x
    Issue #2481201 by joelpittet: Date test passing on travis and in the UI.
    

  • joelpittet committed c659d8c on 7.x-1.x
    Issue #2481201 by joelpittet: Update and fix the tests! Only 3 tests...
mglaman’s picture

Status: Needs work » Needs review
FileSize
9.88 KB

Usage checks for products have been broken, here is patch which fixes them and has passing tests.

mglaman’s picture

Another patch to fix last test.

mglaman’s picture

  • joelpittet committed e16f545 on 7.x-1.x authored by mglaman
    Issue #2481201 by mglaman: Fix tests completed order status
    
joelpittet’s picture

+++ b/modules/commerce_discount_usage/commerce_discount_usage.test
@@ -161,7 +161,7 @@ class CommerceDiscountUsageTest extends CommerceDiscountTestBase {
-    $order = $this->createDummyOrder($this->store_customer2->uid, array($this->product->product_id => 1), 'complete');
+    $order = $this->createDummyOrder($this->store_customer2->uid, array($this->product->product_id => 1), 'completed');

I've committed this change, thanks for spotting that @mglaman

And

+++ b/commerce_discount.test
@@ -470,20 +470,19 @@ class CommerceDiscountTest extends CommerceDiscountTestBase {
-    $discount = $this->createDiscount('product_discount', 'free_products', array($this->product->product_id));
+    $discount = $this->createDiscount('order_discount', 'free_products', array($this->product));

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.

  • joelpittet committed 759b7e3 on 7.x-1.x authored by mglaman
    Issue #2481201 by mglaman, joelpittet: Update and fix free product test
    

  • joelpittet committed 50d50ee on 7.x-1.x authored by mglaman
    Issue #2481201 by mglaman, joelpittet: Update and fix the usage tests!
    
joelpittet’s picture

Status: Needs review » Fixed

Ok 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.

The last submitted patch, 54: update_and_fix_the_tests-2481201-54.patch, failed testing.

Status: Fixed » Needs work

The last submitted patch, 55: update_and_fix_the_tests-2481201-55.patch, failed testing.

mglaman’s picture

Status: Needs work » Fixed

;) Test bot got fixed, so it's running queued patches.

Status: Fixed » Closed (fixed)

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