This topic contains information for developers who work closely with the Adobe Commerce code and want to learn detailed information about the Upgrade Compatibility Tool. You can use this knowledge to customize the tool’s components.
Adobe Commerce API index integration
Adobe Commerce API index integration is an internal integration solution that encompasses a set of tools to explore Adobe Commerce extensions developed by Adobe, Adobe Commerce Partners, and 3rd-party vendors based on static code analysis.
The integration with the Adobe Commerce API index is done through:
It is implemented through the
config/services.yaml file. Its value decides where the response of methods
modules() comes from.
Edit this file to customize the response according to your installation. Just replace the value assigned to
Example of a custom value
sut\Domain\MRay\MRayInterface : "@sut_mray_mock"
In the previous example, the Upgrade Compatibility Tool uses
@sut_mray_mock as the
MRayInterface implementation. The responses from the
modules() methods come from the following files:
When you make changes to the
services.yaml file, delete the
var/cache/ folder to correctly apply them.
To run the unit tests, execute one of the following commands:
vendor/bin/phpunit -c tests/unit/phpunit.xml.dist tests/unit
vendor/bin/phpunit -c tests/unit/phpunit.xml.dist --testsuite=unit-tests
To run the integration tests, execute one of the following commands:
vendor/bin/phpunit -c tests/integration/phpunit.xml.dist tests/integration
vendor/bin/phpunit -c tests/integration/phpunit.xml.dist --testsuite=integration-tests
- Before executing acceptance tests, you must set the Adobe Commerce URL in the
- Copy the default
tests/acceptance/phpunit.xmlfile (without the .dist suffix).
- Change the
TESTS_BASE_URLvalue to point to the Adobe Commerce URL that you want to test.
To run the acceptance tests, execute one of the following commands:
vendor/bin/phpunit -c tests/acceptance/phpunit.xml tests/acceptance
vendor/bin/phpunit -c tests/acceptance/phpunit.xml --testsuite=acceptance-tests
GraphQL unit testing and Eslint code analysis
You must have Node.js on your system, see the documentation.
The following instructions are for MacOS systems:
- Open a terminal and navigate to the root directory of the project.
Install project dependencies:
GraphQL unit testing
The Jest framework was used to create these JS unit tests:
The tests are inside
The string schemas for testing are inside
Run unit tests or
jest as follows:
1 npm run unit-test
Eslint code analysis
eslint code analysis as follows:
1 npm run eslint -- path/to/analyse
The complexity score is a figure that indicates how difficult an upgrade from the current version to the new one might be. Lower numbers indicate easier upgrades.
Complexity scores range between 0 and ∞.
This score is based on the results extracted from the analysis:
- Number of issues identified
- Severity of issues identified
The Upgrade Compatibility Tool calculates this score according to the complexity score formula below.
Complexity score formula
Complexity Score = (Adobe Commerce core errors) * 4 + (Critical errors) * 4 + [(PHP errors)+(GraphQL errors)] * 2 + [(PHP warnings)+(GraphQL warnings)] * 1
These are absolute values.