ho-nl / magento2-reachdigital_testframework Goto Github PK
View Code? Open in Web Editor NEWFaster drop-in replacement for Magento's integration test.
License: MIT License
Faster drop-in replacement for Magento's integration test.
License: MIT License
Thanks :-)
Dependabot can't resolve your PHP dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package magento/framework could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
master
branch failed. π¨I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.
You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. Iβm sure you can resolve this πͺ.
Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.
Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the master
branch. You can also manually restart the failed CI job that runs semantic-release.
If you are not sure how to resolve this, here is some links that can help you:
If those donβt help, or if this issue is reporting something you think isnβt right, you can always ask the humans behind semantic-release.
A Slack Webhook must be created and set in the SLACK_WEBHOOK
environment variable on your CI environment.
Please make sure to create a Slack Webhook and to set it in the SLACK_WEBHOOK
environment variable on your CI environment. Alternatively, provide slackWebhook
as a configuration option.
Good luck with your project β¨
Your semantic-release bot π¦π
Dependabot can't resolve your PHP dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires magento/framework, it could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
Which font and theme are you using in your PHPStorm-Setup? Looks very productive :)
My test looks like this:
class ProductTest extends \Magento\TestFramework\TestCase\AbstractController
{
public static function loadFixture()
{
include __DIR__ . '/../_files/categories.php';
}
/**
* @magentoDbIsolation enabled
* @magentoAppIsolation enabled
* @magentoDataFixture loadFixture
*/
public function testCategory()
{
$this->dispatch('catalog/category/view/id/3');
$this->assertContains('Category 1', $this->getResponse()->getBody());
}
}
Then when I run the integration test with the plugin, the call to $this->dispatch() leads to this error:
Magento\Framework\Exception\LocalizedException: The configuration file has changed. Run the "app:config:import" or the "setup:upgrade" command to synchronize the configuration.
magento/vendor/magento/module-deploy/Model/Plugin/ConfigChangeDetector.php:50
magento/vendor/magento/framework/Interception/Interceptor.php:121
magento/vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:69
magento/vendor/magento/framework/Interception/Interceptor.php:135
magento/vendor/magento/framework/Interception/Interceptor.php:153
magento/generated/code/Magento/Framework/App/FrontController/Interceptor.php:26
magento/vendor/magento/framework/App/Http.php:137
magento/generated/code/Magento/Framework/App/Http/Interceptor.php:24
magento/dev/tests/integration/framework/Magento/TestFramework/Application.php:449
magento/dev/tests/integration/framework/Magento/TestFramework/Helper/Bootstrap.php:117
magento/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php:116
magento/app/code/XYX/Module/Test/Integration/Controller/ProductTest.php:58
Maybe this is related to using/extending AbstractController?
EDIT:
So when I run a test that uses extend \PHPUnit\Framework\TestCase
it works.
Does anyone know what I can do to be able to use Controller Test cases?
Could you please tag a release with the composer.json that supports PHP 7.3?
Thank you!
phpunit.xml
is usually environment-specific, so that I think it should be gitignored. Magento itself has it under gitignore as well. You currently have it in your .gitignore
file, but since this file is not mapped at
magento2-ReachDigital_TestFramework/composer.json
Lines 15 to 32 in bbe4399
dev/tests/quick-integration/
. Is this on purpose or should we map the .gitignore
file as well?
Thanks for your work on this!
Dependabot can't resolve your PHP dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package magento/framework could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
Dependabot can't resolve your PHP dependency files.
As a result, Dependabot couldn't update your dependencies.
The error Dependabot encountered was:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package magento/framework could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.
I think api-tests are similar to integration tests.
Does this here also work for api-functional tests?
I'm trying to run the tests through phpunit
directly instead of having it called through bin/magento dev:tests:run integration
.
Because when I run bin/magento dev:tests:run integration
I see it still runs the normal integration tests;
$ php bin/magento dev:tests:run integration
---- /data/client/magento2/dev/tests/integration> /usr/local/bin/php /data/client/magento2/./vendor/phpunit/phpunit/phpunit
PHPUnit 6.2.4 by Sebastian Bergmann and contributors.
... etc
So I'm running cd dev/tests/quick-integration; php ../../../vendor/phpunit/phpunit/phpunit
.
I then get PHP Fatal error: Uncaught Error: Class 'Magento\TestFramework\Bootstrap\Settings' not found in dev/tests/quick-integration/framework/bootstrap.php:28
.
Is it even possible to run it from the quick-integration
dir directly? And if so, it seems the autoloader doesn't work?
Because you are using the class "Magento\TestFramework\Annotation\IndexerDimensionMode" that has been introduced in 2.2.6
Hi, I've been checking out this framework and the results so far are extremely impressive. It is so much faster than the default Magento.
I have hit an issue though.
When using fixtures to create products, either our own or TTDWizard Magento2-fixtures, we see Elasticsearch errors when the reindex is triggered, causing the tests to fail.
PHPUnit\Framework\Exception: User Deprecated: Specifying types in urls has been deprecated in /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Bulk.php:44.
If I run the test from the default Magento integration dir then all tests pass (though with xdebug I can see that these errors are still thrown by ES).
Running Magento 2.4.5-p1, PHP 8.1.6, ElasticSearch 7.17 (Mark Shust Magento 2 Docker)
Is this a known issue? Do you have any suggestions as to why this may be happening?
~/html/dev/tests/integration$ php ../../../vendor/bin/phpunit
-c ../integration/phpunit.xml
../../../magento2-plugin/module-registry/Test/Integration/Controller/ProductPageTest.php
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.
Warning: Using a custom test suite loader is deprecated
... 3 / 3 (100%)
Time: 00:08.880, Memory: 189.50 MB
OK (3 tests, 12 assertions)
=== Memory Usage System Stats ===
Memory usage (OS): 250.42M (135.00% of 185.50M reported by PHP)
Estimated memory leak: 64.92M (25.93% of used memory)
~/html/dev/tests/integration$ php ../../../vendor/bin/phpunit
-c ../quick-integration/phpunit.xml
../../../magento2-plugin/module-registry/Test/Integration/Controller/ProductPageTest.php
PHPUnit 9.5.28 by Sebastian Bergmann and contributors.
EEE 3 / 3 (100%)
Time: 00:11.302, Memory: 133.00 MB
There were 3 errors:
1) Vendor\Registry\Test\Integration\Controller\ProductPageTest::testRegistryValuesOnEnabledProduct
Magento\Framework\Exception\CouldNotSaveException: The stock item was unable to be saved. Please try again.
/var/www/html/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:196
/var/www/html/vendor/magento/module-catalog-inventory/Model/StockRegistry.php:181
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/CatalogInventory/Model/StockRegistry/Interceptor.php:59
/var/www/html/vendor/magento/module-catalog-inventory/Observer/SaveInventoryDataObserver.php:125
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:88
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:74
/var/www/html/vendor/magento/framework/Event/Manager.php:65
/var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php:95
/var/www/html/vendor/magento/framework/Model/AbstractModel.php:832
/var/www/html/vendor/magento/module-catalog/Model/Product.php:985
/var/www/html/vendor/magento/framework/EntityManager/Observer/AfterEntitySave.php:34
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:88
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:74
/var/www/html/vendor/magento/framework/Event/Manager.php:65
/var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php:95
/var/www/html/vendor/magento/framework/EntityManager/EventManager.php:50
/var/www/html/vendor/magento/framework/EntityManager/Operation/Create.php:123
/var/www/html/vendor/magento/framework/EntityManager/EntityManager.php:106
/var/www/html/vendor/magento/module-catalog/Model/ResourceModel/Product.php:777
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php:58
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php:28
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:135
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php:32
/var/www/html/vendor/magento/module-catalog/Model/ProductRepository.php:886
/var/www/html/vendor/magento/module-catalog/Model/ProductRepository.php:634
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/Catalog/Model/ProductRepository/Interceptor.php:32
/var/www/html/vendor/tddwizard/magento2-fixtures/src/Catalog/ProductBuilder.php:341
/var/www/html/vendor/tddwizard/magento2-fixtures/src/Catalog/ProductBuilder.php:303
/var/www/html/magento2-plugin/module-registry/Test/Integration/Controller/ProductPageTest.php:151
/var/www/html/magento2-plugin/module-registry/Test/Integration/Controller/ProductPageTest.php:38
Caused by
PHPUnit\Framework\Exception: User Deprecated: Specifying types in urls has been deprecated in /var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Bulk.php:44.
/var/www/html/dev/tests/quick-integration/framework/bootstrap.php:201
/var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Endpoints/Bulk.php:44
/var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php:1926
/var/www/html/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Client.php:347
/var/www/html/vendor/magento/module-elasticsearch-7/Model/Client/Elasticsearch.php:173
/var/www/html/vendor/magento/module-elasticsearch/Model/Adapter/Elasticsearch.php:291
/var/www/html/vendor/magento/module-elasticsearch/Model/Indexer/IndexerHandler.php:186
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext.php:220
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext.php:198
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext.php:152
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext.php:250
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Interceptor.php:32
/var/www/html/vendor/magento/module-indexer/Model/Indexer.php:533
/var/www/html/vendor/magento/module-indexer/Model/Indexer/DependencyDecorator.php:294
/var/www/html/vendor/magento/framework/Indexer/AbstractProcessor.php:69
/var/www/html/vendor/magento/module-inventory-catalog-search/Plugin/InventoryIndexer/Indexer/SourceItem/Strategy/Sync/FulltextIndexUpdater.php:77
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:135
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/InventoryIndexer/Indexer/SourceItem/Strategy/Sync/Interceptor.php:23
/var/www/html/vendor/magento/module-inventory-indexer/Indexer/SourceItem/SourceItemReindexStrategy.php:61
/var/www/html/vendor/magento/module-inventory-indexer/Indexer/SourceItem/SourceItemIndexer.php:65
/var/www/html/vendor/magento/module-inventory-indexer/Plugin/InventoryApi/ReindexAfterSourceItemsSavePlugin.php:54
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:146
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/Inventory/Model/SourceItem/Command/SourceItemsSaveWithoutLegacySynchronization/Interceptor.php:23
/var/www/html/vendor/magento/module-inventory-catalog/Model/UpdateSourceItemBasedOnLegacyStockItem.php:89
/var/www/html/vendor/magento/module-inventory-catalog/Plugin/CatalogInventory/UpdateSourceItemAtLegacyStockItemSavePlugin.php:152
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:135
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/CatalogInventory/Model/ResourceModel/Stock/Item/Interceptor.php:23
/var/www/html/vendor/magento/module-catalog-inventory/Model/Stock/StockItemRepository.php:193
/var/www/html/vendor/magento/module-catalog-inventory/Model/StockRegistry.php:181
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/CatalogInventory/Model/StockRegistry/Interceptor.php:59
/var/www/html/vendor/magento/module-catalog-inventory/Observer/SaveInventoryDataObserver.php:125
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:88
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:74
/var/www/html/vendor/magento/framework/Event/Manager.php:65
/var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php:95
/var/www/html/vendor/magento/framework/Model/AbstractModel.php:832
/var/www/html/vendor/magento/module-catalog/Model/Product.php:985
/var/www/html/vendor/magento/framework/EntityManager/Observer/AfterEntitySave.php:34
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:88
/var/www/html/vendor/magento/framework/Event/Invoker/InvokerDefault.php:74
/var/www/html/vendor/magento/framework/Event/Manager.php:65
/var/www/html/generated/code/Magento/Framework/Event/Manager/Proxy.php:95
/var/www/html/vendor/magento/framework/EntityManager/EventManager.php:50
/var/www/html/vendor/magento/framework/EntityManager/Operation/Create.php:123
/var/www/html/vendor/magento/framework/EntityManager/EntityManager.php:106
/var/www/html/vendor/magento/module-catalog/Model/ResourceModel/Product.php:777
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php:58
/var/www/html/vendor/magento/module-catalog-search/Model/Indexer/Fulltext/Plugin/Product.php:28
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:135
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/Catalog/Model/ResourceModel/Product/Interceptor.php:32
/var/www/html/vendor/magento/module-catalog/Model/ProductRepository.php:886
/var/www/html/vendor/magento/module-catalog/Model/ProductRepository.php:634
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:58
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:138
/var/www/html/vendor/magento/framework/Interception/Interceptor.php:153
/var/www/html/generated/code/Magento/Catalog/Model/ProductRepository/Interceptor.php:32
/var/www/html/vendor/tddwizard/magento2-fixtures/src/Catalog/ProductBuilder.php:341
/var/www/html/vendor/tddwizard/magento2-fixtures/src/Catalog/ProductBuilder.php:303
/var/www/html/magento2-plugin/module-registry/Test/Integration/Controller/ProductPageTest.php:151
/var/www/html/magento2-plugin/module-registry/Test/Integration/Controller/ProductPageTest.php:38
...
The composer.json constraints it on 7.2. But M2.3.3 now supports 7.3 so I'd like to upgrade and use this module.
I'm aware that not using this has a positive impact on performance, but it's making it impossible to read sensitive data that I need in my tests. Would it be possible to allow it by setting a config flag in phpunit.xml
?
We use this in one of our projects and tried to upgrade to 2.4.0. However, I found that 103.0.0
is not in the list of available Magento modules.
Is there a timeline for making this update?
When running the Quick Integration tests on Magento 2.4.1, I bumped into the following error: Uncaught RuntimeException: Override fixture resolver isn't initialized in .../dev/tests/integration/framework/Magento/TestFramework/Workaround/Override/Fixture/Resolver.php:69
Diving into this, I see that the bootstrap.php
in Magento 2.4.X is quite different from the bootstrap.php
of the Quick Integration framework. But we can fix that! By adding the following lines of code into the bootstrap.php
file of the Quick Test framework, it works all nicely:
$overrideConfig = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
Magento\TestFramework\Workaround\Override\Config::class
);
$overrideConfig->init();
Magento\TestFramework\Workaround\Override\Config::setInstance($overrideConfig);
Magento\TestFramework\Workaround\Override\Fixture\Resolver::setInstance(
new \Magento\TestFramework\Workaround\Override\Fixture\Resolver($overrideConfig)
);
I placed it somewhere after the Files::setInstance
call.
To be on the safe-side, I've also added the newly created $overrideConfig
variable to the unset
line:
unset($testsBaseDir, $logWriter, $settings, $shell, $application, $bootstrap, $overrideConfig);
Additionally, the phpunit.xml.dist
file needs to include the following line:
<phpunit>
<php>
<const name="USE_OVERRIDE_CONFIG" value="enabled"/>
</php>
</phpunit>
Next, in the class TestFramework\Bootstrap\DocBlock
a new class needs to be added to the return:
new \Magento\TestFramework\Workaround\Override\Fixture\Resolver\TestSetter(),
Now, the question is: Why not add this as a PR? Happy to do that! But because this specifically works for Magento 2.4, I wonder what the best procedure would be, because the PR would make things incompatible with Magento 2.3. Perhaps simply a new branch magento-2.4
and a new major release 2.0?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.