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

fix: wrong di.xml configuration - missing noNamespaceSchemaLocation #82

Merged
merged 1 commit into from
Nov 1, 2023
Merged

fix: wrong di.xml configuration - missing noNamespaceSchemaLocation #82

merged 1 commit into from
Nov 1, 2023

Conversation

LoogleCZ
Copy link
Contributor

@LoogleCZ LoogleCZ commented Nov 1, 2023

fix: wrong di.xml configuration - missing noNamespaceSchemaLocation and xmlns:xsi

This caused static tests for M2 fail and when project is using automated testing for the modules it is inconvenient to exclude this module only. By this change, static tests will pass for this module.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

  • php -d memory_limit=-1 ../../../../code/vendor/bin/phpunit -c phpunit.xml --testsuite "Code Integrity Tests" --filter "SchemaTest"

Output from the command without this change:

PHPUnit 9.5.22 #StandWithUkraine

There was 1 failure:

1) Magento\Test\Integrity\Xml\SchemaTest::testXmlFiles
Passed: 2980, Failed: 1, Incomplete: 0, Skipped: 0.
Data set: /vendor/graycore/magento2-cors/etc/di.xml
The XML file at /app/vendor/graycore/magento2-cors/etc/di.xml does not have a schema properly defined.  It should have a xsi:noNamespaceSchemaLocation attribute defined with a URN path.  E.g. xsi:noNamespaceSchemaLocation="urn:magento:framework:Relative_Path/something.xsd"
Failed asserting that actual size 0 matches expected size 2.
/app/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php:30
/app/vendor/magento/framework/App/Utility/AggregateInvoker.php:57
/app/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php:16

/app/vendor/magento/framework/App/Utility/AggregateInvoker.php:116
/app/vendor/magento/framework/App/Utility/AggregateInvoker.php:71
/app/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php:16

FAILURES!
Tests: 1, Assertions: 8943, Failures: 1.

What is the new behavior?

Desired output (with this change):

PHPUnit 9.5.22 #StandWithUkraine

.

Time: 00:05.666, Memory: 24.00 MB

OK (1 test, 8943 assertions)

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

…nd xmlns:xsi

This caused static tests for M2 fail and when project is using automated testing for the modules
it is inconvenient to exclude this module only. By this change, static tests will pass for this module.

Example how I run tests:

- `php -d memory_limit=-1 ../../../../code/vendor/bin/phpunit -c phpunit.xml --testsuite "Code Integrity Tests" --filter "SchemaTest"`

Output from the command without this change:

```
PHPUnit 9.5.22 #StandWithUkraine

There was 1 failure:

1) Magento\Test\Integrity\Xml\SchemaTest::testXmlFiles
Passed: 2980, Failed: 1, Incomplete: 0, Skipped: 0.
Data set: /vendor/graycore/magento2-cors/etc/di.xml
The XML file at /app/vendor/graycore/magento2-cors/etc/di.xml does not have a schema properly defined.  It should have a xsi:noNamespaceSchemaLocation attribute defined with a URN path.  E.g. xsi:noNamespaceSchemaLocation="urn:magento:framework:Relative_Path/something.xsd"
Failed asserting that actual size 0 matches expected size 2.
/app/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php:30
/app/vendor/magento/framework/App/Utility/AggregateInvoker.php:57
/app/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php:16

/app/vendor/magento/framework/App/Utility/AggregateInvoker.php:116
/app/vendor/magento/framework/App/Utility/AggregateInvoker.php:71
/app/dev/tests/static/testsuite/Magento/Test/Integrity/Xml/SchemaTest.php:16

FAILURES!
Tests: 1, Assertions: 8943, Failures: 1.
```

Desired output (with this change):

```
PHPUnit 9.5.22 #StandWithUkraine

.

Time: 00:05.666, Memory: 24.00 MB

OK (1 test, 8943 assertions)
```
Copy link
Member

@damienwebdev damienwebdev left a comment

Choose a reason for hiding this comment

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

Lgtm

@damienwebdev damienwebdev merged commit 104fd5d into graycoreio:master Nov 1, 2023
@gray-bot gray-bot mentioned this pull request Feb 7, 2024
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