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

Static properties serialization fix. #26175

Conversation

p-bystritsky
Copy link
Contributor

@p-bystritsky p-bystritsky commented Dec 24, 2019

Description (*)

When test cleanup is disabled, Magento\TestFramework\Workaround\Cleanup\StaticProperties is caching static variables before the integration test starts, and restoring them after the test run is finished (if some instance of \Magento\TestFramework\TestCase\AbstractController has run).
Serialization and unserialization of static properties are provided by Magento\Framework\Serialize\Serializer\Json class, which wraps json_encode and json_decode functions.
Some of static properties are objects (e. g. \Magento\Framework\Autoload\AutoloaderRegistry::$autoloader). After encoding and decoding these properties through JSON we are getting arrays instead of objects. So we are facing issues on consecutive runs of integration tests.

Fixed Issues (if relevant)

  1. None

Manual testing scenarios (*)

  1. Disable the application cleanup in integration tests phpunit.xml:
    <const name="TESTS_CLEANUP" value="disabled"/>
  2. Run some controller integration test (e. g. \Magento\Newsletter\Controller\ManageTest)
  3. Run some another controller integration test (e. g. AdminNotification test bundle)

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Static properties serialization fix. #28319: Static properties serialization fix.

Resolved issues:

  1. resolves [Issue] Static properties serialization fix. #29313: Static properties serialization fix.

@m2-assistant
Copy link

m2-assistant bot commented Dec 24, 2019

Hi @p-bystritsky. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@p-bystritsky p-bystritsky force-pushed the static_properties_serialization_fix branch from 8a881e8 to 2339529 Compare December 27, 2019 10:24
@p-bystritsky p-bystritsky force-pushed the static_properties_serialization_fix branch from 2339529 to 9383fe1 Compare December 27, 2019 10:28
@ihor-sviziev
Copy link
Contributor

@magento run all tests

@ihor-sviziev ihor-sviziev self-assigned this Mar 3, 2020
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

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

Hi @p-bystritsky,
Could you review test failures and fix your solution?

@ihor-sviziev ihor-sviziev added Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix labels Mar 18, 2020
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7142 has been created to process this Pull Request

@engcom-Echo
Copy link
Contributor

@magento run all tests

@engcom-Echo engcom-Echo self-assigned this Mar 31, 2020
@ihor-sviziev ihor-sviziev added the Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. label Apr 28, 2020
@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented May 5, 2020

@engcom-Alfa @engcom-Echo I see this PR in testing more than 1 month. I think you just missed it

@engcom-Echo
Copy link
Contributor

✔️ QA Passed

✖️ Before:
image

✔️ After:

image

@slavvka
Copy link
Member

slavvka commented Jul 13, 2020

@magento run Integration Tests

Copy link
Member

@slavvka slavvka left a comment

Choose a reason for hiding this comment

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

@p-bystritsky Integration tests are failing again. Could you please fix them?

@VladimirZaets
Copy link
Contributor

@magento create issue

@engcom-Echo
Copy link
Contributor

@magento run all tests

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Aug 6, 2020

@slavvka integration test are not failing on CI before & after merging 2.4-develop branch. Where we can see that they were failing?
https://github.com/magento/magento2/pull/26175/checks?check_run_id=945245712

@magento-engcom-team
Copy link
Contributor

Hi @slavvka, thank you for the review.
ENGCOM-7142 has been created to process this Pull Request

@slavvka
Copy link
Member

slavvka commented Aug 13, 2020

@magento run all tests

@magento-engcom-team magento-engcom-team merged commit ed83a6a into magento:2.4-develop Aug 14, 2020
@m2-assistant
Copy link

m2-assistant bot commented Aug 14, 2020

Hi @p-bystritsky, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Award: bug fix Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Static properties serialization fix. [Issue] Static properties serialization fix.
9 participants