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 tested $fileName in exception message for consistency #32447

Open
wants to merge 4 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

chris-pook
Copy link
Contributor

Description

This is a fix for #32446. The adapter does not necessarily have $this->_fileName set in the scenario where $filename doesn't exist. In this case the logged exception has an empty filename. For consistency it is best to use the $filename param value here as that is the one that was tested to exist and has the correct value.

Fixed Issues (if relevant)

  1. Fixes Image filename not necessarily set when logging file not found error #32446

Manual testing scenarios (*)

  1. In extension code use \Magento\Framework\Image\Factory::create($filePath) where $filePath is not a valid file.
  2. View var/log/exception.log

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)

This is a fix for magento#32446. The adapter does not necessarily have $this->_fileName set in the scenario where $filename doesn't exist. For consistency it is best to use the $filename param value here as that is the one that was tested to exist and has the correct value.
@m2-assistant
Copy link

m2-assistant bot commented Mar 11, 2021

Hi @chris-pook. Thank you for your contribution
Here are 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

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

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

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added this to Pending Review in Pull Requests Dashboard Mar 11, 2021
@Den4ik Den4ik added Priority: P3 May be fixed according to the position in the backlog. Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”. labels Mar 11, 2021
@Den4ik Den4ik self-assigned this Mar 11, 2021
@m2-community-project m2-community-project bot moved this from Pending Review to Review in Progress in Pull Requests Dashboard Mar 11, 2021
@Den4ik
Copy link
Contributor

Den4ik commented Mar 11, 2021

@magento run all tests

@Den4ik Den4ik added the Cleanup label Mar 11, 2021
@Den4ik
Copy link
Contributor

Den4ik commented Mar 12, 2021

@magento run Functional Tests B2B, Integration Tests

@chris-pook
Copy link
Contributor Author

@magento run Functional Tests B2B

1 similar comment
@Den4ik
Copy link
Contributor

Den4ik commented Apr 28, 2021

@magento run Functional Tests B2B

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

Copy link
Contributor

@Den4ik Den4ik left a comment

Choose a reason for hiding this comment

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

Hi @chris-pook Thanks for your contribution
Failed B2B test is not related to changes in this PR

@m2-community-project m2-community-project bot moved this from Review in Progress to Ready for Testing in Pull Requests Dashboard Apr 28, 2021
@magento-engcom-team
Copy link
Contributor

Hi @Den4ik, thank you for the review.
ENGCOM-9055 has been created to process this Pull Request
✳️ @Den4ik, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@Den4ik Den4ik added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Apr 28, 2021
@Den4ik
Copy link
Contributor

Den4ik commented Apr 30, 2021

@magento run Functional Tests B2B

@magento-automated-testing
Copy link

The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time.

@m2-community-project m2-community-project bot moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Feb 5, 2024
@m2-community-project m2-community-project bot moved this from Ready for Testing to Extended Testing (optional) in Pull Requests Dashboard Feb 6, 2024
@engcom-Delta
Copy link
Contributor

engcom-Delta commented Feb 6, 2024

✔️ QA Passed

Preconditions:

  • Install fresh Magento 2.4-develop

Manual testing scenario:

1.In extension code use \Magento\Framework\Image\Factory::create($filePath) where $filePath is not a valid file.
2.Create main.ERROR: File "" does not exist exception.
3.View magento root/var/log/exception.log

Before: ✖️ 

Screenshot 2024-02-06 at 7 43 38 PM exception log

After: ✔️  

exception

Builds are failed. Hence, moving this PR to Extended Testing.

@engcom-Echo engcom-Echo self-assigned this Feb 6, 2024
@m2-community-project m2-community-project bot moved this from Extended Testing (optional) to Ready for Testing in Pull Requests Dashboard Feb 6, 2024
@m2-community-project m2-community-project bot moved this from Ready for Testing to Extended Testing (optional) in Pull Requests Dashboard Feb 8, 2024
@engcom-Echo
Copy link
Contributor

@magento run all tests

@engcom-Echo
Copy link
Contributor

@magento run Functional Tests EE,Functional Tests B2B,Functional Tests CE,Integration Tests

@engcom-Echo
Copy link
Contributor

@magento run Functional Tests EE,Functional Tests CE,Functional Tests B2B

@engcom-Echo
Copy link
Contributor

Failing functional test are not related to PR changes.
Hence moving it to merge in progress

@engcom-Echo engcom-Echo moved this from Extended Testing (optional) to Merge in Progress in Pull Requests Dashboard Feb 20, 2024
@engcom-Charlie
Copy link
Contributor

@engcom-Echo please add supporting information about build failures. Moving it to Extended Testing.

@engcom-Charlie engcom-Charlie moved this from Merge in Progress to Extended Testing (optional) in Pull Requests Dashboard Apr 10, 2024
@engcom-Echo
Copy link
Contributor

@magento run all tests

@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B ,Functional Tests EE, Functional Tests CE,Integration Tests ,WebAPI Tests

@engcom-Echo
Copy link
Contributor

Functional Tests B2B,Functional Tests CE,Functional Tests EE failure are known and remaining different on last two run on same commit.
Known Failure:

ACQE-3807 - AdminAdobeStockImagePreviewSameSeriesSeeMoreTest
ACQE-6450 - AdminAdobeStockImagePreviewSameModelSeeMoreTestz
ACQE-6018 - AdminCreateShipmentWithBundleAndSimpleProductsSingleStockModeTest
ACQE-5677 - StorefrontQuoteCanBeRenamedUntilLockedTest
ACQE-6438 - StorefrontPropertiesOfAProductAttributeTest
ACQE-6454 - AdminSeeMoreFromSeriesTest
ACQE-6349 - AdminContentHierarchyDisabledScopeWebsiteFilterTest
ACQE-6438 - StorefrontPropertiesOfAProductAttributeTest
ACQE-6331 - StorefrontCreateOrderAllQuantityGroupedProductOptionDefaultStockTest

Functional Tests B2B
Run1
32447-b2b

Run2
32447-b2b2

Functional Tests CE
Run1
32447-ce

Run2
32447-ce2

Functional Tests EE
Run1
32447-ee

Run2
32447-ee2

WebAPI Tests
Screenshot 2024-04-15 at 5 55 19 PM

Integration Tests
Screenshot 2024-04-15 at 5 55 24 PM

Hence moving it to merge in progress

@engcom-Echo engcom-Echo moved this from Extended Testing (optional) to Merge in Progress in Pull Requests Dashboard Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Cleanup Component: Image Priority: P3 May be fixed according to the position in the backlog. Progress: accept Release Line: 2.4 Severity: S4 Affects aesthetics, professional look and feel, “quality” or “usability”.
Projects
Pull Requests Dashboard
  
Merge in Progress
Development

Successfully merging this pull request may close these issues.

Image filename not necessarily set when logging file not found error
7 participants