Skip to content

Conversation

@peterjaap
Copy link
Contributor

Description

This PR adds a --format=json to the vendor/bin/magento-patches status command.

$ vendor/bin/magento-patches status --format=json                                                                                          
[                              
    {                                      
        "Id": "MDVA-30106", 
        "Title": "Fixes the issue where during checkout, payments are not load\ned with \u201cCannot read property \u2018length\u2019 of null \u201d err\nor in JS console.\n",               
        "Category": "Order\/Checkout\nPayments",                                               
        "Origin": "Adobe Commerce Support",
        "Status": "Applied",    
        "Details": "Patch type: Optional\nAffected components:\n - magento\/module-ui"                                                                                                        
    }
]

This allows us to automate stuff concerning these patches better in our CI/CD deployments.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • Pull request introduces user-facing changes and includes meaningful updates for any required release notes and documentation changes
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

❌  One or more functional acceptance tests have failed.

PHP 7.2

  • ❌  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ✅  Acceptance73CeCest
  • ✅  Acceptance73Cest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  AcceptanceCest
  • ✅  PatchApplierCest

Output for failed tests is below. If many tests have failed only the first 5 will be included. If you need additional information please reach out to the Magento Cloud team for more details.

This comment was generated by Jenkins job magento-cloud-patches/functional build 102.

@magento-cloud-ft-jenkins-svc

PHP 7.2 Acceptance72CeCest Output

Codeception PHP Testing Framework v4.1.31 https://helpukrainewin.org
Powered by PHPUnit 8.5.26 #StandWithUkraine

Acceptance Tests (4) ---------------------------------------
Acceptance72CeCest: Test patches | "2.3.0"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.0"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/m...","dev-devel..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/m...","1.0.x-dev..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/q...","dev-maste..."
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/e...","dev-devel..."
 I assert true true,"Can not add dependency magento/ece-..."
 I get work dir path 
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/p...",">=2.3.0 <..."
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance72CeCest: Test patches | "2.3.1"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.1"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/m...","dev-devel..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/m...","1.0.x-dev..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/q...","dev-maste..."
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/e...","dev-devel..."
 I assert true true,"Can not add dependency magento/ece-..."
 I get work dir path 
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/p...",">=2.3.1 <..."
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I stop environment 
 I remove work dir 
 FAIL 

------------------------------------
Message: Failed asserting that  on page /
-->  Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/colinmollenhour/credis/Client.php on line 456 Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/col
[Content too long to display. See complete response in '/app/tests/functional/_output/' directory]
--> contains "Home page".
------------------------------------
Stack Trace: 
#0 /app/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php(55): PHPUnit\Framework\Constraint\Constraint->fail(' Warning: Redis...', '')
#1 /app/vendor/phpunit/phpunit/src/Framework/Assert.php(2924): PHPUnit\Framework\Constraint\Constraint->evaluate(' Warning: Redis...', '')
#2 /app/vendor/codeception/lib-asserts/src/Codeception/Util/Shared/InheritedAsserts.php(1369): PHPUnit\Framework\Assert::assertThat(' Warning: Redis...', Object(Codeception\PHPUnit\Constraint\Page), '')
#3 /app/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php(1838): Codeception\Module->assertThat(' Warning: Redis...', Object(Codeception\PHPUnit\Constraint\Page), '')
#4 /app/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php(546): Codeception\Lib\InnerBrowser->assertPageContains('Home page')
#5 [internal function]: Codeception\Lib\InnerBrowser->see('Home page')
#6 /app/vendor/codeception/codeception/src/Codeception/Step.php(285): call_user_func_array(Array, Array)
#7 /app/vendor/codeception/codeception/src/Codeception/Scenario.php(76): Codeception\Step->run(Object(Codeception\Lib\ModuleContainer))
#8 /app/vendor/magento/magento-cloud-docker/tests/functional/_support/_generated/CliTesterActions.php(1114): Codeception\Scenario->runStep(Object(Codeception\Step\Assertion))
#9 /app/src/Test/Functional/Acceptance/AcceptanceCest.php(42): CliTester->see('Home page')
#10 [internal function]: Magento\CloudPatches\Test\Functional\Acceptance\AcceptanceCest->testPatches(Object(CliTester), Object(Codeception\Example))
#11 /app/vendor/codeception/codeception/src/Codeception/Lib/Di.php(128): ReflectionMethod->invokeArgs(Object(Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest), Array)
#12 /app/vendor/codeception/codeception/src/Codeception/Test/Cest.php(138): Codeception\Lib\Di->injectDependencies(Object(Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest), 'testPatches', Array)
#13 /app/vendor/codeception/codeception/src/Codeception/Test/Cest.php(147): Codeception\Test\Cest->invoke('testPatches', Array)
#14 /app/vendor/codeception/codeception/src/Codeception/Test/Cest.php(82): Codeception\Test\Cest->executeTestMethod(Object(CliTester))
#15 /app/vendor/codeception/codeception/src/Codeception/Test/Test.php(98): Codeception\Test\Cest->test()
#16 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(626): Codeception\Test\Test->run(Object(PHPUnit\Framework\TestResult))
#17 /app/vendor/codeception/phpunit-wrapper/src/Runner.php(117): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#18 /app/vendor/codeception/codeception/src/Codeception/SuiteManager.php(161): Codeception\PHPUnit\Runner->doEnhancedRun(Object(Codeception\Suite), Object(PHPUnit\Framework\TestResult), Array)
#19 /app/vendor/codeception/codeception/src/Codeception/Codecept.php(208): Codeception\SuiteManager->run(Object(Codeception\PHPUnit\Runner), Object(PHPUnit\Framework\TestResult), Array)
#20 /app/vendor/codeception/codeception/src/Codeception/Codecept.php(162): Codeception\Codecept->runSuite(Array, 'Acceptance', 'Acceptance72CeC...')
#21 /app/vendor/codeception/codeception/src/Codeception/Command/Run.php(403): Codeception\Codecept->run('Acceptance', 'Acceptance72CeC...', Array)
#22 /app/vendor/symfony/console/Command/Command.php(255): Codeception\Command\Run->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /app/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /app/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Codeception\Command\Run), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /app/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /app/vendor/codeception/codeception/src/Codeception/Application.php(117): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /app/vendor/codeception/codeception/app.php(46): Codeception\Application->run()
#28 /app/vendor/codeception/codeception/app.php(47): {closure}()
#29 /app/vendor/codeception/codeception/codecept(7): require('/app/vendor/cod...')
#30 {main}
------------------------------------
Acceptance72CeCest: Test patches | "2.3.2","2.3.2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.2"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/m...","dev-devel..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/m...","1.0.x-dev..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/q...","dev-maste..."
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/e...","dev-devel..."
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance72CeCest: Test patches | "2.3.2","2.3.2-p2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.2"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/m...","dev-devel..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/m...","1.0.x-dev..."
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/q...","dev-maste..."
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/e...","dev-devel..."
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.2-p2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

------------------------------------------------------------
84x DEPRECATION: Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell. /app/vendor/symfony/process/Process.php:147
44x DEPRECATION: The Robo\Common\ProcessUtils::escapeArgument() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0. /app/vendor/consolidation/robo/src/Common/ProcessUtils.php:39


Time: 30.11 minutes, Memory: 24.00 MB

There was 1 failure:

---------
1) Acceptance72CeCest: Test patches | "2.3.1"
 Test  src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
 Step  See "Home page"
 Fail  Failed asserting that  on page /
-->  Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/colinmollenhour/credis/Client.php on line 456 Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/col
[Content too long to display. See complete response in '/app/tests/functional/_output/' directory]
--> contains "Home page".

Scenario Steps:

 41. $I->removeWorkDir() at src/Test/Functional/Acceptance/AbstractCest.php:99
 40. $I->stopEnvironment() at src/Test/Functional/Acceptance/AbstractCest.php:98
 39. $I->see("Home page") at src/Test/Functional/Acceptance/AcceptanceCest.php:42
 38. $I->amOnPage("/") at src/Test/Functional/Acceptance/AcceptanceCest.php:41
 37. $I->assertTrue(true) at src/Test/Functional/Acceptance/AcceptanceCest.php:40
 36. $I->runDockerComposeCommand("run deploy cloud-post...") at src/Test/Functional/Acceptance/AcceptanceCest.php:40

Artifacts:

Html: /app/tests/functional/_output/Magento.CloudPatches.Test.Functional.Acceptance.Acceptance72CeCest.testPatches.3546214.fail.html
Response: /app/tests/functional/_output/Magento.CloudPatches.Test.Functional.Acceptance.Acceptance72CeCest.testPatches.3546214.fail.html

FAILURES!
Tests: 4, Assertions: 39, Failures: 1.
- XML report generated in file:///app/tests/functional/_output/junit.xml

This comment was generated by Jenkins job magento-cloud-patches/functional build 102.

@peterjaap
Copy link
Contributor Author

@BaDos @bubasuma the failing functional test isn't due to my new code but due to a configuration error for the tests, it seems.

@ihor-sviziev
Copy link

maybe @viktym can review?

@bubasuma
Copy link
Contributor

bubasuma commented Sep 6, 2022

@peterjaap Please merge develop into your branch, the test should restart automatically

@BaDos
Copy link
Contributor

BaDos commented Sep 6, 2022

Hi @peterjaap
I have a task in our backlog to process this PR.

@peterjaap
Copy link
Contributor Author

@bubasuma I merged develop into my branch, should be uptodate now!

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

❌  One or more functional acceptance tests have failed.

PHP 7.2

  • ✅  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ❌  Acceptance73CeCest
  • ✅  Acceptance73Cest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  PatchApplierCest
  • ✅  AcceptanceCest

Output for failed tests is below. If many tests have failed only the first 5 will be included. If you need additional information please reach out to the Magento Cloud team for more details.

This comment was generated by Jenkins job magento-cloud-patches/functional build 118.

@magento-cloud-ft-jenkins-svc

PHP 7.3 Acceptance73CeCest Output

Codeception PHP Testing Framework v4.2.2 https://helpukrainewin.org
Powered by PHPUnit 9.5.25 #StandWithUkraine

Acceptance Tests (14) --------------------------------------
Acceptance73CeCest: Test patches | "2.3.3","2.3.3"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.3"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.3"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.3","2.3.3-p1"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.3"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.3-p1"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.4","2.3.4"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.4"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.4"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.4","2.3.4-p2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.4"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.4-p2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.5","2.3.5"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.5"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.5"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.5","2.3.5-p1"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.5"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.5-p1"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.5","2.3.5-p2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.5"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.5-p2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.6","2.3.6"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.6"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.6"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.6","2.3.6-p1"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.6"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.6-p1"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.7","2.3.7"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.7"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.7"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.7","2.3.7-p1"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.7"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.7-p1"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.7","2.3.7-p2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.7"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.7-p2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.3.7","2.3.7-p3"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.7"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.7-p3"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance73CeCest: Test patches | "2.4.0","2.4.0"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance73CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.4.0"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true false,"Can not add dependency magento/mag..."
 I stop environment 
 ERROR 

------------------------------------------------------------
228x DEPRECATION: Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell. /app/vendor/symfony/process/Process.php:147
95x DEPRECATION: The Robo\Common\ProcessUtils::escapeArgument() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0. /app/vendor/consolidation/robo/src/Common/ProcessUtils.php:39


Time: 01:22:47.371, Memory: 26.00 MB

There was 1 error:

---------
1) Acceptance73CeCest: Test patches | "2.4.0","2.4.0"
 Test  src/Test/Functional/Acceptance/Acceptance73CeCest.php:testPatches
                                                                                                            
  [Robo\Exception\TaskExitException]   in task Magento\CloudDocker\Test\Functional\Robo\Tasks\EnvDown 

    
                                                                                                            

Scenario Steps:

 15. $I->stopEnvironment() at src/Test/Functional/Acceptance/AbstractCest.php:98
 14. $I->assertTrue(false,"Can not add dependency magen...") at src/Test/Functional/Acceptance/AbstractCest.php:57
 13. $I->addDependencyToComposer("magento/mage...","^1.0.0") at src/Test/Functional/Acceptance/AbstractCest.php:56
 12. $I->getDependencyVersion("magento/magento-cloud-do...") at src/Test/Functional/Acceptance/AbstractCest.php:56
 11. $I->addCloudComponentsGitRepoToComposer() at src/Test/Functional/Acceptance/AbstractCest.php:45
 10. $I->addEceToolsGitRepoToComposer() at src/Test/Functional/Acceptance/AbstractCest.php:44

#1  /app/vendor/consolidation/robo/src/Result.php:262
#2  /app/vendor/consolidation/robo/src/Result.php:250
#3  /app/vendor/magento/magento-cloud-docker/tests/functional/Codeception/Docker.php:64
#4  Magento\CloudDocker\Test\Functional\Codeception\Docker->stopEnvironment
#5  /app/vendor/magento/magento-cloud-docker/tests/functional/_support/_generated/CliTesterActions.php:721
#6  /app/src/Test/Functional/Acceptance/AbstractCest.php:98
#7  Magento\CloudPatches\Test\Functional\Acceptance\AbstractCest->_after

ERRORS!
Tests: 14, Assertions: 131, Errors: 1.
- XML report generated in file:///app/tests/functional/_output/junit.xml

This comment was generated by Jenkins job magento-cloud-patches/functional build 118.

@peterjaap
Copy link
Contributor Author

@BaDos @bubasuma I have no idea why the above test fails, not sure it even has to do with the contents of this PR?

@viktym
Copy link
Contributor

viktym commented Sep 28, 2022

Hi @peterjaap
Thanks for contribution
Could you please add test coverage to https://github.com/magento/magento-cloud-patches/blob/develop/src/Test/Unit/Command/Process/
Current build failure is not related to your PR

@viktym
Copy link
Contributor

viktym commented Sep 28, 2022

Proposed changes to Magento\CloudPatches\Command\Process\ShowStatus

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
declare(strict_types=1);

namespace Magento\CloudPatches\Command\Process;

use Magento\CloudPatches\Command\Process\Action\ReviewAppliedAction;
use Magento\CloudPatches\Console\QuestionFactory;
use Magento\CloudPatches\Patch\Data\AggregatedPatch;
use Magento\CloudPatches\Patch\Data\AggregatedPatchInterface;
use Magento\CloudPatches\Patch\Pool\LocalPool;
use Magento\CloudPatches\Patch\Pool\OptionalPool;
use Magento\CloudPatches\Patch\Aggregator;
use Magento\CloudPatches\Patch\Status\StatusPool;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Show information about available patches and their statuses.
 */
class ShowStatus implements ProcessInterface
{
    const INTERACTIVE_FILTER_THRESHOLD = 50;

    const FILTER_OPTION_ALL = 'All';

    const FORMAT_JSON = 'json';

    /**
     * @var Aggregator
     */
    private $aggregator;

    /**
     * @var OptionalPool
     */
    private $optionalPool;

    /**
     * @var LocalPool
     */
    private $localPool;

    /**
     * @var StatusPool
     */
    private $statusPool;

    /**
     * @var ReviewAppliedAction
     */
    private $reviewAppliedAction;

    /**
     * @var Renderer
     */
    private $renderer;

    /**
     * @var QuestionHelper
     */
    private $questionHelper;

    /**
     * @var QuestionFactory
     */
    private $questionFactory;

    /**
     * @param Aggregator $aggregator
     * @param OptionalPool $optionalPool
     * @param LocalPool $localPool
     * @param StatusPool $statusPool
     * @param ReviewAppliedAction $reviewAppliedAction
     * @param Renderer $renderer
     * @param QuestionHelper $questionHelper
     * @param QuestionFactory $questionFactory
     */
    public function __construct(
        Aggregator $aggregator,
        OptionalPool $optionalPool,
        LocalPool $localPool,
        StatusPool $statusPool,
        ReviewAppliedAction $reviewAppliedAction,
        Renderer $renderer,
        QuestionHelper $questionHelper,
        QuestionFactory $questionFactory
    ) {
        $this->aggregator = $aggregator;
        $this->optionalPool = $optionalPool;
        $this->localPool = $localPool;
        $this->statusPool = $statusPool;
        $this->reviewAppliedAction = $reviewAppliedAction;
        $this->renderer = $renderer;
        $this->questionHelper = $questionHelper;
        $this->questionFactory = $questionFactory;
    }

    /**
     * @inheritDoc
     */
    public function run(InputInterface $input, OutputInterface $output)
    {
        $isJsonFormat = $input->getOption('format') === self::FORMAT_JSON;
        $patches = $this->aggregator->aggregate(
            array_merge($this->optionalPool->getList(), $this->localPool->getList())
        );

        if (!$isJsonFormat) {
            $this->printDetailsInfo($output);
            $this->reviewAppliedAction->execute($input, $output, []);
            foreach ($patches as $patch) {
                if ($patch->isDeprecated() && $this->isPatchVisible($patch)) {
                    $this->printDeprecatedWarning($output, $patch);
                }
            }
        }

        $patches = $this->filterNotVisiblePatches($patches);

        if (!$isJsonFormat && count($patches) > self::INTERACTIVE_FILTER_THRESHOLD) {
            $this->printPatchProviders($output, $patches);
            $patches = $this->filterByPatchProvider($input, $output, $patches);
            $this->printCategoriesInfo($output, $patches);
            $patches = $this->filterByPatchCategory($input, $output, $patches);
        }

        if ($isJsonFormat) {
            $this->renderer->printJson($output, array_values($patches));
        } else {
            $this->renderer->printTable($output, array_values($patches));
        }
    }

    /**
     * @param array $patches
     * @return array
     */
    private function filterNotVisiblePatches(array $patches): array
    {
        return array_filter(
            $patches,
            function ($patch) {
                return !$patch->isDeprecated() || $this->isPatchVisible($patch);
            }
        );
    }

    /**
     * @param OutputInterface $output
     * @param array $patches
     */
    private function printPatchProviders(OutputInterface $output, array $patches)
    {
        $patchProviders = [self::FILTER_OPTION_ALL=> count($patches)];
        /** @var  AggregatedPatch $patch */
        foreach ($patches as $patch) {
            if (!isset($patchProviders[$patch->getOrigin()])) {
                $patchProviders[$patch->getOrigin()] = 0;
            }
            $patchProviders[$patch->getOrigin()]++;
        }

        $providersInfo = PHP_EOL . '<info>Patch providers:</info>' . PHP_EOL;
        $i = 1;
        foreach ($patchProviders as $type => $count) {
            $providersInfo .= sprintf('<info>%d) %s (%s)</info>', $i, $type, $count) . PHP_EOL;
            $i++;
        }

        $output->writeln($providersInfo);
    }

    /**
     * @param array $patches
     * @return array
     */
    private function getPatchProviders(array $patches): array
    {
        $patchTypes = [self::FILTER_OPTION_ALL];
        /** @var  AggregatedPatch $patch */
        foreach ($patches as $patch) {
            if (!in_array($patch->getOrigin(), $patchTypes)) {
                $patchTypes[] = $patch->getOrigin();
            }
        }
        return $patchTypes;
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @param array $patches
     * @return array
     */
    private function filterByPatchProvider(InputInterface $input, OutputInterface $output, array $patches): array
    {
        $typeQuestion = $this->questionFactory->create('Please, select patch provider: ', self::FILTER_OPTION_ALL);
        $selectedType = $this->questionHelper->ask($input, $output, $typeQuestion);

        if (is_numeric($selectedType)) {
            $patchTypes = $this->getPatchProviders($patches);
            $selectedType = $patchTypes[(int)$selectedType - 1] ?? self::FILTER_OPTION_ALL;
        }

        $output->writeln('<info>Selected patch provider: ' . $selectedType . '</info>' . PHP_EOL);
        return $selectedType === self::FILTER_OPTION_ALL
            ? $patches
            : array_filter(
                $patches,
                function ($patch) use ($selectedType) {
                    return strtolower($patch->getOrigin()) === strtolower($selectedType);
                }
            );
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @param array $patches
     * @return array
     */
    private function filterByPatchCategory(InputInterface $input, OutputInterface $output, array $patches): array
    {
        $categoryQuestion = $this->questionFactory->create('Please, select patch category: ', self::FILTER_OPTION_ALL);
        $selectedCategory = $this->questionHelper->ask($input, $output, $categoryQuestion);

        if (is_numeric($selectedCategory)) {
            $allPatchCategories = $this->getPatchCategories($patches);
            $selectedCategory = $allPatchCategories[(int)$selectedCategory - 1] ?? $allPatchCategories[0];
        }

        $output->writeln('<info>Selected patch category: ' . $selectedCategory . '</info>' . PHP_EOL);
        return $selectedCategory === self::FILTER_OPTION_ALL
            ? $patches
            : array_filter(
                $patches,
                function ($patch) use ($selectedCategory) {
                    $patchCategories = $patch->getCategories();
                    $patchCategories = array_map('strtolower', $patchCategories);
                    $selectedCategory = strtolower($selectedCategory);
                    return in_array($selectedCategory, $patchCategories);
                }
            );
    }

    /**
     * @param array $patches
     * @return string[]
     */
    private function getPatchCategories(array $patches): array
    {
        $categories = [self::FILTER_OPTION_ALL];

        /** @var  AggregatedPatch $patch */
        foreach ($patches as $patch) {
            foreach ($patch->getCategories() as $patchCategory) {
                if (!in_array($patchCategory, $categories)) {
                    $categories[] = $patchCategory;
                }
            }
        }
        return $categories;
    }

    /**
     * Prints information where to find more details about patches.
     *
     * @param OutputInterface $output
     * @return void
     */
    private function printDetailsInfo(OutputInterface $output)
    {
        $supportUrl = 'https://support.magento.com';
        $releaseNotesUrl = 'https://devdocs.magento.com/quality-patches/release-notes.html';

        $output->writeln(
            '<info>Patch details you can find on </info>' .
            sprintf('<href=%1$s>%1$s</> <info>(search for patch id, ex. MDVA-30265)</info>', $supportUrl) .
            PHP_EOL .
            sprintf('<info>Release notes</info> <href=%1$s>%1$s</>', $releaseNotesUrl)
        );
    }

    /**
     * Prints patches category information
     *
     * @param OutputInterface $output
     * @param array $patches
     * @return void
     */
    private function printCategoriesInfo(OutputInterface $output, array $patches)
    {
        $categories = [self::FILTER_OPTION_ALL => count($patches)];

        /** @var  AggregatedPatch $patch */
        foreach ($patches as $patch) {
            foreach ($patch->getCategories() as $patchCategory) {
                if (!isset($categories[$patchCategory])) {
                    $categories[$patchCategory] = 0;
                }
                $categories[$patchCategory]++;
            }
        }

        $categoriesInfo = PHP_EOL . '<info>Patch categories:</info>' . PHP_EOL;
        $i = 1;
        foreach ($categories as $category => $count) {
            $categoriesInfo .= sprintf('<info>%d) %s (%s)</info>', $i, $category, $count) . PHP_EOL;
            $i++;
        }

        $output->writeln($categoriesInfo);
    }

    /**
     * Prints warning message about applied deprecated patch.
     *
     * @param OutputInterface $output
     * @param AggregatedPatchInterface $patch
     * @return void
     */
    private function printDeprecatedWarning(OutputInterface $output, AggregatedPatchInterface $patch)
    {
        $message = sprintf(
            '<error>Deprecated patch %s is currently applied. Please, consider to revert it%s</error>',
            $patch->getId(),
            $patch->getReplacedWith() ? ' and replace with ' . $patch->getReplacedWith() : '.'
        );
        $output->writeln($message);
    }

    /**
     * Defines if the patch should be visible in the status table.
     *
     * @param AggregatedPatchInterface $patch
     * @return bool
     */
    private function isPatchVisible(AggregatedPatchInterface $patch): bool
    {
        return $patch->getReplacedWith() ?
            $this->statusPool->isApplied($patch->getId()) && !$this->statusPool->isApplied($patch->getReplacedWith()) :
            $this->statusPool->isApplied($patch->getId());
    }
}

Co-authored-by: Viktor Tymchynskyi <vtymchynskyi@magento.com>
@peterjaap
Copy link
Contributor Author

@viktym

Could you please add test coverage to https://github.com/magento/magento-cloud-patches/blob/develop/src/Test/Unit/Command/Process/

Sorry I'm not big on tests. What exactly do you want me to add there?

@viktym
Copy link
Contributor

viktym commented Sep 28, 2022

@viktym

Could you please add test coverage to https://github.com/magento/magento-cloud-patches/blob/develop/src/Test/Unit/Command/Process/

Sorry I'm not big on tests. What exactly do you want me to add there?

Ok, we can skip unit test for this code
Please check this comment #86 (comment)

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

✅  All functional acceptance tests have passed.

PHP 7.2

  • ✅  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ✅  Acceptance73CeCest
  • ✅  Acceptance73Cest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  PatchApplierCest
  • ✅  AcceptanceCest

This comment was generated by Jenkins job magento-cloud-patches/functional build 119.

@peterjaap
Copy link
Contributor Author

@viktym I've committed the changes that refactored the ($input->getOption('format') === 'json') part into $isJsonFormat.

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

❌  One or more functional acceptance tests have failed.

PHP 7.2

  • ❌  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ✅  Acceptance73CeCest
  • ✅  Acceptance73Cest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  PatchApplierCest
  • ✅  AcceptanceCest

Output for failed tests is below. If many tests have failed only the first 5 will be included. If you need additional information please reach out to the Magento Cloud team for more details.

This comment was generated by Jenkins job magento-cloud-patches/functional build 120.

@magento-cloud-ft-jenkins-svc

PHP 7.2 Acceptance72CeCest Output

Codeception PHP Testing Framework v4.2.2 https://helpukrainewin.org
Powered by PHPUnit 8.5.30 #StandWithUkraine

Acceptance Tests (4) ---------------------------------------
Acceptance72CeCest: Test patches | "2.3.0"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.0"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I get work dir path 
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/p...",">=2.3.0 <..."
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I stop environment 
 I remove work dir 
 FAIL 

------------------------------------
Message: Failed asserting that  on page /
-->  Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/colinmollenhour/credis/Client.php on line 456 Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/col
[Content too long to display. See complete response in '/app/tests/functional/_output/' directory]
--> contains "Home page".
------------------------------------
Stack Trace: 
#0 /app/vendor/phpunit/phpunit/src/Framework/Constraint/Constraint.php(55): PHPUnit\Framework\Constraint\Constraint->fail(' Warning: Redis...', '')
#1 /app/vendor/phpunit/phpunit/src/Framework/Assert.php(2952): PHPUnit\Framework\Constraint\Constraint->evaluate(' Warning: Redis...', '')
#2 /app/vendor/codeception/lib-asserts/src/Codeception/Util/Shared/InheritedAsserts.php(1369): PHPUnit\Framework\Assert::assertThat(' Warning: Redis...', Object(Codeception\PHPUnit\Constraint\Page), '')
#3 /app/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php(1838): Codeception\Module->assertThat(' Warning: Redis...', Object(Codeception\PHPUnit\Constraint\Page), '')
#4 /app/vendor/codeception/lib-innerbrowser/src/Codeception/Lib/InnerBrowser.php(546): Codeception\Lib\InnerBrowser->assertPageContains('Home page')
#5 [internal function]: Codeception\Lib\InnerBrowser->see('Home page')
#6 /app/vendor/codeception/codeception/src/Codeception/Step.php(285): call_user_func_array(Array, Array)
#7 /app/vendor/codeception/codeception/src/Codeception/Scenario.php(76): Codeception\Step->run(Object(Codeception\Lib\ModuleContainer))
#8 /app/vendor/magento/magento-cloud-docker/tests/functional/_support/_generated/CliTesterActions.php(1114): Codeception\Scenario->runStep(Object(Codeception\Step\Assertion))
#9 /app/src/Test/Functional/Acceptance/AcceptanceCest.php(42): CliTester->see('Home page')
#10 [internal function]: Magento\CloudPatches\Test\Functional\Acceptance\AcceptanceCest->testPatches(Object(CliTester), Object(Codeception\Example))
#11 /app/vendor/codeception/codeception/src/Codeception/Lib/Di.php(128): ReflectionMethod->invokeArgs(Object(Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest), Array)
#12 /app/vendor/codeception/codeception/src/Codeception/Test/Cest.php(138): Codeception\Lib\Di->injectDependencies(Object(Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest), 'testPatches', Array)
#13 /app/vendor/codeception/codeception/src/Codeception/Test/Cest.php(147): Codeception\Test\Cest->invoke('testPatches', Array)
#14 /app/vendor/codeception/codeception/src/Codeception/Test/Cest.php(82): Codeception\Test\Cest->executeTestMethod(Object(CliTester))
#15 /app/vendor/codeception/codeception/src/Codeception/Test/Test.php(98): Codeception\Test\Cest->test()
#16 /app/vendor/phpunit/phpunit/src/Framework/TestSuite.php(620): Codeception\Test\Test->run(Object(PHPUnit\Framework\TestResult))
#17 /app/vendor/codeception/phpunit-wrapper/src/Runner.php(117): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#18 /app/vendor/codeception/codeception/src/Codeception/SuiteManager.php(161): Codeception\PHPUnit\Runner->doEnhancedRun(Object(Codeception\Suite), Object(PHPUnit\Framework\TestResult), Array)
#19 /app/vendor/codeception/codeception/src/Codeception/Codecept.php(208): Codeception\SuiteManager->run(Object(Codeception\PHPUnit\Runner), Object(PHPUnit\Framework\TestResult), Array)
#20 /app/vendor/codeception/codeception/src/Codeception/Codecept.php(162): Codeception\Codecept->runSuite(Array, 'Acceptance', 'Acceptance72CeC...')
#21 /app/vendor/codeception/codeception/src/Codeception/Command/Run.php(401): Codeception\Codecept->run('Acceptance', 'Acceptance72CeC...', Array)
#22 /app/vendor/symfony/console/Command/Command.php(255): Codeception\Command\Run->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#23 /app/vendor/symfony/console/Application.php(1009): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#24 /app/vendor/symfony/console/Application.php(273): Symfony\Component\Console\Application->doRunCommand(Object(Codeception\Command\Run), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#25 /app/vendor/symfony/console/Application.php(149): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#26 /app/vendor/codeception/codeception/src/Codeception/Application.php(117): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#27 /app/vendor/codeception/codeception/app.php(46): Codeception\Application->run()
#28 /app/vendor/codeception/codeception/app.php(47): {closure}()
#29 /app/vendor/codeception/codeception/codecept(7): require('/app/vendor/cod...')
#30 {main}
------------------------------------
Acceptance72CeCest: Test patches | "2.3.1"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.1"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I get work dir path 
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/p...",">=2.3.1 <..."
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance72CeCest: Test patches | "2.3.2","2.3.2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.2"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/product-c...","2.3.2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

Acceptance72CeCest: Test patches | "2.3.2","2.3.2-p2"
Signature: Magento\CloudPatches\Test\Functional\Acceptance\Acceptance72CeCest:testPatches
Test: src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
Scenario --
 I cleanup work dir 
 I clone template to work dir "2.3.2"
 I create auth json 
 I create artifacts dir 
 I create artifact current tested code "patches","1.0.99"
 I add artifacts repo to composer 
 I add dependency to composer "magento/magento-...","1.0.99"
 I add ece docker git repo to composer 
 I add quality patches git repo to composer 
 I add ece tools git repo to composer 
 I add cloud components git repo to composer 
 I get dependency version "magento/magento-cloud-docker"
 I add dependency to composer "magento/magento-...","^1.0.0"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/magento-cloud-components"
 I add dependency to composer "magento/magento-...","^1.0.8"
 I assert true true,"Can not add dependency magento/mage..."
 I get dependency version "magento/quality-patches"
 I add dependency to composer "magento/quality-...","^1.1.0"
 I assert true true,"Can not add dependency magento/qual..."
 I get dependency version "magento/ece-tools"
 I add dependency to composer "magento/ece-t...","^2002.1.0"
 I assert true true,"Can not add dependency magento/ece-..."
 I remove dependency from composer "magento/magento-clou..."
 I add dependency to composer "magento/produc...","2.3.2-p2"
 I composer update 
 I copy file to work dir "files/patche...",".magento.env..."
 I generate docker compose "--mode=production --env-vars..."
 I run docker compose command "run build cloud-build"
 I assert true true
 I start environment 
 I assert true true
 I run docker compose command "run deploy cloud-deploy"
 I assert true true
 I run docker compose command "run deploy cloud-post-deploy"
 I assert true true
 I am on page "/"
 I see "Home page"
 I see "CMS homepage content goes here."
 I stop environment 
 I remove work dir 
 PASSED 

------------------------------------------------------------
68x DEPRECATION: Passing a command as string when creating a "Symfony\Component\Process\Process" instance is deprecated since Symfony 4.2, pass it as an array of its arguments instead, or use the "Process::fromShellCommandline()" constructor if you need features provided by the shell. /app/vendor/symfony/process/Process.php:147
28x DEPRECATION: The Robo\Common\ProcessUtils::escapeArgument() method is a copy of a method that was deprecated by Symfony 3.3 and removed in Symfony 4; it will be removed in Robo 2.0. /app/vendor/consolidation/robo/src/Common/ProcessUtils.php:39


Time: 30.71 minutes, Memory: 24.00 MB

There was 1 failure:

---------
1) Acceptance72CeCest: Test patches | "2.3.0"
 Test  src/Test/Functional/Acceptance/Acceptance72CeCest.php:testPatches
 Step  See "Home page"
 Fail  Failed asserting that  on page /
-->  Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/colinmollenhour/credis/Client.php on line 456 Warning: Redis::connect(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /app/vendor/col
[Content too long to display. See complete response in '/app/tests/functional/_output/' directory]
--> contains "Home page".

Scenario Steps:

 41. $I->removeWorkDir() at src/Test/Functional/Acceptance/AbstractCest.php:99
 40. $I->stopEnvironment() at src/Test/Functional/Acceptance/AbstractCest.php:98
 39. $I->see("Home page") at src/Test/Functional/Acceptance/AcceptanceCest.php:42
 38. $I->amOnPage("/") at src/Test/Functional/Acceptance/AcceptanceCest.php:41
 37. $I->assertTrue(true) at src/Test/Functional/Acceptance/AcceptanceCest.php:40
 36. $I->runDockerComposeCommand("run deploy cloud-post...") at src/Test/Functional/Acceptance/AcceptanceCest.php:40

Artifacts:

Html: /app/tests/functional/_output/Magento.CloudPatches.Test.Functional.Acceptance.Acceptance72CeCest.testPatches.4d7cb84.fail.html
Response: /app/tests/functional/_output/Magento.CloudPatches.Test.Functional.Acceptance.Acceptance72CeCest.testPatches.4d7cb84.fail.html

FAILURES!
Tests: 4, Assertions: 39, Failures: 1.
- XML report generated in file:///app/tests/functional/_output/junit.xml

This comment was generated by Jenkins job magento-cloud-patches/functional build 120.

Comment on lines 77 to 79
if ($input->getOption('format') !== 'json') {
$output->writeln('<info>' . $this->magentoVersion->get() . '</info>');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ($input->getOption('format') !== 'json') {
$output->writeln('<info>' . $this->magentoVersion->get() . '</info>');
}
if ($input->getOption('format') !== 'json') {
$output->writeln('<info>' . $this->magentoVersion->get() . '</info>');
}

@peterjaap Better to move this code to \Magento\CloudPatches\Command\Process\ShowStatus class along with \Magento\CloudPatches\Composer\MagentoVersion dependency. In this case you also need to update constructors in \Magento\CloudPatches\Test\Unit\Command\Process\ShowStatusTest and \Magento\CloudPatches\Test\Unit\Command\StatusTest

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, please update unit tests \Magento\CloudPatches\Test\Unit\Command\Process\ShowStatusTest and \Magento\CloudPatches\Test\Unit\Command\StatusTest because currently they are failing after moving \Magento\CloudPatches\Composer\MagentoVersion dependency

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No thanks. You can do it if you'd like, you were the one that suggested the change.

I'll just close this PR otherwise, it has taken me too much time already for such a little feature.

And people wonder why it takes ages to merge something into the Magento codebase...

Copy link
Contributor

@viktym viktym Oct 3, 2022

Choose a reason for hiding this comment

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

@peterjaap no problem, I can help you with the unit tests update. It's not about Magento, you will not be able to merge a PR to any other OS project with red builds. The requirement for test coverage is in DoD (definition of done), sorry.
Please check PR peterjaap#1

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

✅  All functional acceptance tests have passed.

PHP 7.2

  • ✅  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ✅  Acceptance73Cest
  • ✅  Acceptance73CeCest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  PatchApplierCest
  • ✅  AcceptanceCest

This comment was generated by Jenkins job magento-cloud-patches/functional build 121.

Co-authored-by: Viktor Tymchynskyi <vtymchynskyi@magento.com>
@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

✅  All functional acceptance tests have passed.

PHP 7.2

  • ✅  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ✅  Acceptance73CeCest
  • ✅  Acceptance73Cest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  PatchApplierCest
  • ✅  AcceptanceCest

This comment was generated by Jenkins job magento-cloud-patches/functional build 122.

@peterjaap
Copy link
Contributor Author

@viktym thanks!! I merged your PR into my branch.

@magento-cloud-ft-jenkins-svc

Functional Acceptance Test Results

✅  All functional acceptance tests have passed.

PHP 7.2

  • ✅  Acceptance72CeCest
  • ✅  Acceptance72Cest

PHP 7.3

  • ✅  Acceptance73CeCest
  • ✅  Acceptance73Cest

PHP 7.4

  • ✅  Acceptance74CeCest
  • ✅  Acceptance74Cest

PHP 8.1

  • ✅  PatchApplierCest
  • ✅  AcceptanceCest

This comment was generated by Jenkins job magento-cloud-patches/functional build 123.

@viktym
Copy link
Contributor

viktym commented Oct 14, 2022

@peterjaap thanks for your contribution. This PR will be processed and the code changes will be available in the next magento/magento-cloud-patches release

@viktym
Copy link
Contributor

viktym commented Oct 14, 2022

@m2-github-services
Copy link

@viktym the Pull Request is successfully imported.

@magento-devops-reposync-svc magento-devops-reposync-svc merged commit 5cfcad4 into magento:develop Oct 14, 2022
@m2-community-project m2-community-project bot added Progress: done and removed Progress: review PR/issue status labels Oct 14, 2022
@BaDos
Copy link
Contributor

BaDos commented Oct 14, 2022

It will be in the next release MCP 1.0.20

magento-devops-reposync-svc pushed a commit that referenced this pull request Sep 13, 2023
MCLOUD-11149: MCP Release 1.0.24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants