Created on 18 October 2024, 6 months ago

Problem/Motivation

Fix the failing tests

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Active

Version

2.0

Component

Code

Created by

🇩🇪Germany Anybody Porta Westfalica

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @Anybody
  • Merge request !21Fixed tests → (Open) created by Anybody
  • 🇮🇳India kulpratap2002

    Trying to fix.

  • 🇩🇪Germany Anybody Porta Westfalica

    Looks like some of the issues are from upstream commerce now. We'll have to check this more in deep.

    @kul.pratap please use a separate MR to not break anything already working...

  • 🇩🇪Germany Anybody Porta Westfalica

    We need to get the pipeline green again, so other issues can be fixed with more confidence!
    Setting priority to major for that reason.

  • 🇮🇳India lavanyatalwar

    Working on it.

  • Pipeline finished with Canceled
    5 months ago
    Total: 150s
    #328963
  • Pipeline finished with Failed
    5 months ago
    Total: 319s
    #328970
  • Pipeline finished with Failed
    5 months ago
    Total: 346s
    #329825
  • 🇩🇪Germany Anybody Porta Westfalica

    @lavanyatalwar adding translations to tests is totally wrong (in most places), please revert these commits.
    If you're unsure about changes you make, please use a separate branch for these changes to not pollute existing valid fixes!

    Thank you.

  • 🇮🇳India lavanyatalwar

    Hi @anybody,

    I apologize for the confusion with the recent changes. It looks like I misunderstood the requirements and implemented them incorrectly. I'll go ahead and revert the changes right away.

  • Pipeline finished with Failed
    5 months ago
    Total: 271s
    #329954
  • 🇩🇪Germany Anybody Porta Westfalica

    @rhovland: We should tackle this next together with 📌 Add Explicit Return Types and Discussion on Return Value Active

  • First commit to issue fork.
  • Pipeline finished with Failed
    about 1 month ago
    Total: 307s
    #436095
  • 🇺🇸United States rhovland Oregon

    This last commit to fix getComment() brings the phpcs error "Only string literals should be passed to t() where possible"

    From what I can understand passing variables to t() is wrong and should not be done. The source of the comments is where translation is supposed to be happening. Only done in the event subscriber.

  • 🇺🇸United States rhovland Oregon

    Remaining errors:
    GiftcardAdminTest::testRefund The text "Refund gift card" was not found anywhere in the text of the current page.

    Best I can tell "Refund gift card" is not on the page after placing an order because the current user in the test doesn't have permissions for that route.

    GiftcardRedemptionPaneTest:

    All of these errors don't make sense because they should be present. The output of these tests aren't in the artifacts so I can't tell what is wrong here.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 325s
    #436360
  • Pipeline finished with Failed
    about 1 month ago
    Total: 295s
    #436369
  • Pipeline finished with Failed
    about 1 month ago
    Total: 399s
    #436382
  • Pipeline finished with Failed
    about 1 month ago
    Total: 458s
    #436394
  • Pipeline finished with Failed
    about 1 month ago
    Total: 371s
    #436403
  • Pipeline finished with Failed
    about 1 month ago
    Total: 357s
    #436412
  • Pipeline finished with Failed
    about 1 month ago
    Total: 364s
    #436429
  • Pipeline finished with Failed
    about 1 month ago
    Total: 420s
    #437110
  • Pipeline finished with Failed
    about 1 month ago
    Total: 301s
    #437142
  • Pipeline finished with Failed
    about 1 month ago
    Total: 444s
    #437148
  • Pipeline finished with Failed
    about 1 month ago
    Total: 546s
    #437196
  • Pipeline finished with Failed
    about 1 month ago
    Total: 311s
    #437205
  • Pipeline finished with Failed
    about 1 month ago
    Total: 315s
    #437214
  • Pipeline finished with Failed
    about 1 month ago
    Total: 545s
    #437221
  • Pipeline finished with Failed
    about 1 month ago
    Total: 465s
    #437267
  • Pipeline finished with Failed
    about 1 month ago
    Total: 343s
    #437277
  • Pipeline finished with Failed
    about 1 month ago
    Total: 450s
    #437290
  • Pipeline finished with Failed
    about 1 month ago
    Total: 300s
    #437296
  • Pipeline finished with Failed
    about 1 month ago
    Total: 414s
    #437299
  • Pipeline finished with Failed
    about 1 month ago
    Total: 340s
    #437303
  • Pipeline finished with Failed
    about 1 month ago
    Total: 467s
    #437304
  • 🇺🇸United States rhovland Oregon

    Ha I actually fixed the testRefund test...

    Looking at the tests in commerce I noticed absolutely none of them clicked on order transition links/buttons and instead triggered a state change in the order with code then saved it. Clicking the place order button wasn't changing the order's state from draft. Additionally for whatever reason the refund gift card action link wasn't appearing on the resulting page.

    Since the important parts of the first section of the test are verifying that the order has been placed (in completed state and gift card balance changed) and that the refund route is accessible I switched to invoking those directly. These should be functionally the same for the purposes of the test. Once on the refund page the rest of the test can proceed normally.

    Working on moving the needed changes over to the merge request branch

  • 🇩🇪Germany Anybody Porta Westfalica

    Great work @rhovland!! Feel free to set this needs review, once it's ready and I'll ask our team to have a look :)

  • Pipeline finished with Failed
    about 1 month ago
    Total: 361s
    #441160
  • 🇺🇸United States rhovland Oregon

    Ok I figured out what was causing the last group of totals errors. The creation of the tax is not working anymore in the setUp() function for the GiftcardRedemptionPaneTest. So the expected totals are off because the order has no tax on it.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 334s
    #441228
  • Pipeline finished with Failed
    about 1 month ago
    Total: 302s
    #441247
  • Pipeline finished with Failed
    about 1 month ago
    Total: 329s
    #441284
  • Pipeline finished with Failed
    about 1 month ago
    Total: 287s
    #441449
  • Pipeline finished with Failed
    about 1 month ago
    Total: 541s
    #441463
  • 🇺🇸United States rhovland Oregon

    Digging into the code of this test I'm starting to doubt it ever worked. It was literally in the wrong namespace (commerce_promotion) until the most recent changes to fix phpcs violations and such. Other than having taxes shoved in there there's a ton of similarities to commerce_promotion's CouponRedemptionPaneTest.

    The problem as it stands is that I don't know how this custom made up tax is supposed to work so I can't begin to tell if the assert statements are testing it correctly and there's an issue with the tax setup or if the assertions are wrong and tax setup is correct.

    I'll keep digging but I thought I'd share what I've found so far.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 315s
    #441472
  • 🇩🇪Germany Anybody Porta Westfalica

    Thank you so much @rhovland! Great findings and progress. Sorry for the quietness on my end, I'll try to help asap again.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 316s
    #442067
  • Pipeline finished with Failed
    about 1 month ago
    Total: 341s
    #442145
  • Pipeline finished with Failed
    about 1 month ago
    Total: 308s
    #442175
  • Pipeline finished with Failed
    about 1 month ago
    Total: 371s
    #442194
  • Pipeline finished with Failed
    about 1 month ago
    Total: 317s
    #442223
  • Pipeline finished with Failed
    about 1 month ago
    Total: 349s
    #442240
  • Pipeline finished with Failed
    about 1 month ago
    Total: 332s
    #442343
  • 🇺🇸United States rhovland Oregon

    Fixed tests.
    I removed the taxes from the test because they were breaking things and as implemented wasn't actually testing the interaction between taxes and giftcards. I opened a new issue to add a separate test for taxes. 📌 Add a test for tax interaction Active

    Form submissions (review step, complete step) were broken because of upstream commerce changes. I used the CouponRedemptionPaneTest in upstream as a basis for changes to the test setup. This fixed form submissions.

    There are 3 remaining test failures. They are legitimate failures caused by faulty code in commerce_giftcard.module. Specifically commerce_giftcard_preprocess_commerce_checkout_completion_message assumes that order items have purchased entities attached to them. This is optional for order items and will cause a WSOD on the checkout complete step of any stores creating basic order items on orders with no purchased entities attached (probably not common).
    Additionally, the code wouldn't ever work anyways because it assumes that giftcard transactions have a reference to the order item id instead of the order id which is what is actually stored on transactions.

    I will work to fix this bug tomorrow and button up the tests with some additional cleanup.

  • Pipeline finished with Canceled
    about 1 month ago
    Total: 86s
    #443098
  • Pipeline finished with Success
    about 1 month ago
    Total: 304s
    #443100
  • 🇺🇸United States rhovland Oregon

    Created a separate branch with the code changes from 🐛 WSOD on order completion page when order has items without purchased entites Active .

    All tests now pass once both issues are committed.

    Doing some code cleanup on tests and then this is ready for review.

  • Pipeline finished with Success
    about 1 month ago
    Total: 316s
    #443111
  • Pipeline finished with Success
    about 1 month ago
    Total: 313s
    #443123
  • 🇺🇸United States rhovland Oregon

    Code cleanup done. This is ready for review and commit and so is 🐛 WSOD on order completion page when order has items without purchased entites Active

  • Pipeline finished with Failed
    about 1 month ago
    Total: 505s
    #443218
  • Pipeline finished with Failed
    about 1 month ago
    #443221
  • 🇩🇪Germany Anybody Porta Westfalica

    Impressive work @rhovland! :) I'll ask @grevil for a review in the next days. Thank you very much!

  • Pipeline finished with Failed
    about 1 month ago
    Total: 563s
    #445007
  • Pipeline finished with Success
    about 1 month ago
    Total: 394s
    #445097
  • 🇩🇪Germany Grevil

    Thanks, @rhovland!

    I'll come back to you asap, putting this issue and 🐛 WSOD on order completion page when order has items without purchased entites Active on my list!

Production build 0.71.5 2024