Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a fixed SKU number when testing product adapter #2559

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

mikkamp
Copy link
Contributor

@mikkamp mikkamp commented Aug 22, 2024

Changes proposed in this Pull Request:

The change here introduced in WC 9.2, adds a numeric suffix to the SKU when generating products. This is only a default value if the property is not set. So this PR passes a fixed SKU when generating the product so it will be consistent when we compare it in the test results.

Closes #2556

Detailed test instructions:

  1. Install latest versions for unit testing bin/install-wp-tests.sh <db_name> <db_user> <db_pass>
  2. Run unit tests vendor/bin/phpunit
  3. Confirm that the test test_maps_rules_product_fields_sku no longer fails
  4. Check the unit tests in this PR against the latest version of WC and ensure it passes

Changelog entry

  • Dev - Use a fixed SKU number when testing product adapter.

Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.0%. Comparing base (315fce2) to head (4c9d6db).
Report is 3 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##             develop   #2559   +/-   ##
=========================================
  Coverage       65.0%   65.0%           
  Complexity      4588    4588           
=========================================
  Files            475     475           
  Lines          17900   17900           
=========================================
  Hits           11640   11640           
  Misses          6260    6260           
Flag Coverage Δ
php-unit-tests 65.0% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@martynmjones martynmjones left a comment

Choose a reason for hiding this comment

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

Hey @mikkamp, thanks for the fix.

Confirmed the AttributeMappingWCProductAdapterTest::test_maps_rules_product_fields_sku test passes with the latest version of WC using this branch.

@mikkamp mikkamp merged commit ec86226 into develop Aug 23, 2024
14 checks passed
@mikkamp mikkamp deleted the dev/2556-fixed-sku branch August 23, 2024 08:28
@tomalec tomalec mentioned this pull request Aug 27, 2024
22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: dev Developer-facing only change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unit test for SKU failing
2 participants