Closed
Conversation
Contributor
|
@sol-loup has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Contributor
rubycalling
pushed a commit
that referenced
this pull request
Apr 16, 2025
Summary: ## Description This PR addresses noisy error logs originating from `WC_Facebookcommerce_Utils::fblog` during PHPUnit tests in `WCFacebookCommerceIntegrationTest`. These errors occurred because the `wc_facebook_external_merchant_settings_id` option (External Merchant Settings ID) was not set during test execution, leading to false positive error messages like "external merchant setting is null". The fix involves initializing this option with a dummy value (`'dummy_ems_id'`) within the `setUp()` method of the `WCFacebookCommerceIntegrationTest` class. This ensures the setting is present before relevant tests run, preventing the erroneous `fblog` calls. Additionally, this PR includes the following test cleanup: - Deleted the test `test_allow_full_batch_api_sync_uses_allow_full_batch_api_sync_filter` as it was testing a deprecated option (`allow_full_batch_api_sync`) and was already marked as skipped. - Removed `markTestSkipped` annotations from `test_get_js_sdk_version_returns_id_from_options_using_no_filter` and `test_get_js_sdk_version_returns_id_with_filter` as they now pass successfully. ### Type of change - Bug fix (non-breaking change which fixes an issue) - Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues) ## Checklist - [] I have commented my code, particularly in hard-to-understand areas. - [] I have confirmed that my changes do not introduce any new PHPCS warnings or errors. - [] I followed general Pull Request best practices. Meta employees to follow this [wiki](https://fburl.com/wiki/2cgfduwc). - [] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes. - [] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality. - [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki](https://fburl.com/wiki/nhx73tgs). ## Changelog entry Fix - Prevent spurious error logs during unit tests by initializing external merchant settings ID. Fix - Remove obsolete/skipped unit tests and enable previously skipped tests that now pass. Pull Request resolved: #3058 Test Plan: Imported from GitHub, without a `Test Plan:` line. **!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!** MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/6192449709976434 MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/14073748913725649 Reviewed By: carterbuce Differential Revision: D72987618 Pulled By: sol-loup fbshipit-source-id: 8e0762d8462ddbe95a31555c061d53e3fdd931f5
7 tasks
mradmeta
pushed a commit
to mradmeta/facebook-for-woocommerce
that referenced
this pull request
Apr 22, 2025
Summary: ## Description This PR addresses noisy error logs originating from `WC_Facebookcommerce_Utils::fblog` during PHPUnit tests in `WCFacebookCommerceIntegrationTest`. These errors occurred because the `wc_facebook_external_merchant_settings_id` option (External Merchant Settings ID) was not set during test execution, leading to false positive error messages like "external merchant setting is null". The fix involves initializing this option with a dummy value (`'dummy_ems_id'`) within the `setUp()` method of the `WCFacebookCommerceIntegrationTest` class. This ensures the setting is present before relevant tests run, preventing the erroneous `fblog` calls. Additionally, this PR includes the following test cleanup: - Deleted the test `test_allow_full_batch_api_sync_uses_allow_full_batch_api_sync_filter` as it was testing a deprecated option (`allow_full_batch_api_sync`) and was already marked as skipped. - Removed `markTestSkipped` annotations from `test_get_js_sdk_version_returns_id_from_options_using_no_filter` and `test_get_js_sdk_version_returns_id_with_filter` as they now pass successfully. ### Type of change - Bug fix (non-breaking change which fixes an issue) - Syntax change (non-breaking change which fixes code modularity, linting or phpcs issues) ## Checklist - [] I have commented my code, particularly in hard-to-understand areas. - [] I have confirmed that my changes do not introduce any new PHPCS warnings or errors. - [] I followed general Pull Request best practices. Meta employees to follow this [wiki](https://fburl.com/wiki/2cgfduwc). - [] I have added tests (if necessary) and all the new and existing unit tests pass locally with my changes. - [] I have completed dogfooding and QA testing, or I have conducted thorough due diligence to ensure that it does not break existing functionality. - [] I have updated or requested update to plugin documentations (if necessary). Meta employees to follow this [wiki](https://fburl.com/wiki/nhx73tgs). ## Changelog entry Fix - Prevent spurious error logs during unit tests by initializing external merchant settings ID. Fix - Remove obsolete/skipped unit tests and enable previously skipped tests that now pass. Pull Request resolved: facebook#3058 Test Plan: Imported from GitHub, without a `Test Plan:` line. **!---- (auto-generated) DO NOT EDIT OR PUT ANYTHING AFTER THIS LINE ----!** MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: www / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/6192449709976434 MFTRunTestsScript Run / Test Suite: sa_checkout / Test Collection: bloks / Diff Version V1 https://internalfb.com/intern/testinfra/testrun/14073748913725649 Reviewed By: carterbuce Differential Revision: D72987618 Pulled By: sol-loup fbshipit-source-id: 8e0762d8462ddbe95a31555c061d53e3fdd931f5
This was referenced Apr 23, 2025
This was referenced May 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses noisy error logs originating from
WC_Facebookcommerce_Utils::fblogduring PHPUnit tests inWCFacebookCommerceIntegrationTest. These errors occurred because thewc_facebook_external_merchant_settings_idoption (External Merchant Settings ID) was not set during test execution, leading to false positive error messages like "external merchant setting is null".The fix involves initializing this option with a dummy value (
'dummy_ems_id') within thesetUp()method of theWCFacebookCommerceIntegrationTestclass. This ensures the setting is present before relevant tests run, preventing the erroneousfblogcalls.Additionally, this PR includes the following test cleanup:
test_allow_full_batch_api_sync_uses_allow_full_batch_api_sync_filteras it was testing a deprecated option (allow_full_batch_api_sync) and was already marked as skipped.markTestSkippedannotations fromtest_get_js_sdk_version_returns_id_from_options_using_no_filterandtest_get_js_sdk_version_returns_id_with_filteras they now pass successfully.Type of change
Checklist
Changelog entry
Fix - Prevent spurious error logs during unit tests by initializing external merchant settings ID.
Fix - Remove obsolete/skipped unit tests and enable previously skipped tests that now pass.
Pull Request resolved: #3058
GitHub Author: Paul Kang sollipse@meta.com