Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@trojanh
Copy link
Contributor

@trojanh trojanh commented Dec 11, 2019

Resolves #4284
Impact: minor
Type: test|chore

Issue

Use Factory mocks for Catalog integration and removes tests/mocks

Testing

  1. Make sure tests pass

@trojanh trojanh changed the title Eliminate factory mocks [WIP] Eliminate factory mocks Dec 11, 2019
@trojanh trojanh force-pushed the eliminate-factory-mocks branch 4 times, most recently from 0aeedaf to 35e4f8c Compare December 11, 2019 12:59
@willopez willopez self-requested a review December 11, 2019 15:01
@willopez
Copy link
Member

@trojanh one of your commits is not signed off, please follow instructions here: https://github.com/reactioncommerce/reaction/pull/5892/checks?check_run_id=343813454

@trojanh trojanh force-pushed the eliminate-factory-mocks branch 3 times, most recently from 77c0ce8 to 21241a9 Compare December 11, 2019 15:20
@willopez
Copy link
Member

@trojanh the DCO check is still failing, this is the specific commit that is missing the sign off: 7b162ca

@trojanh trojanh force-pushed the eliminate-factory-mocks branch from bb2c13e to df5e72a Compare December 12, 2019 06:04
@trojanh trojanh force-pushed the eliminate-factory-mocks branch from df5e72a to c97d424 Compare December 12, 2019 06:17
@trojanh
Copy link
Contributor Author

trojanh commented Dec 12, 2019

I have fixed that commit @willopez , thanks for helping me with this.

@trojanh trojanh force-pushed the eliminate-factory-mocks branch from c97d424 to 22ddea9 Compare December 12, 2019 06:31
@trojanh trojanh force-pushed the eliminate-factory-mocks branch from 22ddea9 to c934431 Compare December 12, 2019 06:36
@trojanh
Copy link
Contributor Author

trojanh commented Dec 12, 2019

@willopez I have updated the test cases to use Factory mocks but one test is failing as offset doesn't seem to be working as expected i.e no matter what offset value I use it returns the same number of items, so next and previous pages are not present as expected earlier.

You can check the test case here

Let me know if this should be behaving like this or do I need to update my code somewhere.

@willopez
Copy link
Member

willopez commented Dec 16, 2019

@trojanh Let's revert the updates you made to the catalogItems.test.js for the featured sort test case. That particular query will be re-written soon, and the existing test case will work for now. This will allow us to move forward with this PR. Also, update this PR by merging the latest release-3.0.0 branch to fix the issue where the integration tests were running out of memory.

@trojanh
Copy link
Contributor Author

trojanh commented Dec 17, 2019

@willopez are you suggesting I keep using the mock folder for that particular test case, while we update the query to fix the underlying issue?

If you can confirm there's an issue with the catalogItems for featured products query, I could fix that along with this test case.

If this PR needs to be shipped without the fix, maybe I can comment or skip that particular test case with an explanation and we do it in another PR.

Let me know your thoughts because the original intention of this PR was to eliminate the mocks folder.

@willopez
Copy link
Member

@trojanh Let's break the catalogItems test case into its own PR and move forward with the rest in this PR. There is no bug AFAK with the sort by featured query, what I meant is that it will be re-written to be more performant in the future. So, the test is failing due to the use of the new mock factories, just not sure what is causing the issue. So, if you can debug and find out why that is, that would be great.

@trojanh trojanh changed the title [WIP] Eliminate factory mocks [WIP] Eliminate factory mocks for catalogItemProduct Dec 17, 2019
@trojanh trojanh changed the title [WIP] Eliminate factory mocks for catalogItemProduct Eliminate factory mocks for catalogItemProduct Dec 17, 2019
@trojanh
Copy link
Contributor Author

trojanh commented Dec 17, 2019

@willopez done, will create another PR for catalogItems tests and debug the issue. Thanks

Copy link
Member

@willopez willopez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @trojanh

@willopez willopez merged commit 0727f88 into reactioncommerce:release-3.0.0 Dec 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants