From c9b9af6ed478f6481753885b736d7c9101f5cf4e Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Wed, 23 Oct 2024 13:08:58 -0700 Subject: [PATCH 1/3] CLI-1342: [push:artifact] improve docs --- src/Command/Push/PushArtifactCommand.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Command/Push/PushArtifactCommand.php b/src/Command/Push/PushArtifactCommand.php index f4c0246c2..389c42b05 100644 --- a/src/Command/Push/PushArtifactCommand.php +++ b/src/Command/Push/PushArtifactCommand.php @@ -57,7 +57,8 @@ protected function configure(): void ->acceptEnvironmentId() ->setHelp('This command builds a sanitized deploy artifact by running composer install, removing sensitive files, and committing vendor directories.' . PHP_EOL . PHP_EOL . 'Vendor directories and scaffold files are committed to the build artifact even if they are ignored in the source repository.' . PHP_EOL . PHP_EOL - . 'To run additional build or sanitization steps (e.g. npm install), add a post-install-cmd script to your composer.json file: https://getcomposer.org/doc/articles/scripts.md#command-events') + . 'To run additional build or sanitization steps (e.g. npm install), add a post-install-cmd script to your composer.json file: https://getcomposer.org/doc/articles/scripts.md#command-events' . PHP_EOL . PHP_EOL + . 'This command is designed for a specific scenario in which there are two branches or repositories involved: a source branch without vendor files committed, and an artifact branch with them. If both your source and destination branches are the same, you should simply use git push instead.') ->addUsage('--destination-git-branch=main-build') ->addUsage('--source-git-tag=foo-build --destination-git-tag=1.0.0') ->addUsage('--destination-git-urls=example@svn-1.prod.hosting.acquia.com:example.git --destination-git-urls=example@svn-2.prod.hosting.acquia.com:example.git --destination-git-branch=main-build'); From 1c4def194caa984172b1e0b4ec3fd6255668eabe Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Wed, 23 Oct 2024 13:16:28 -0700 Subject: [PATCH 2/3] kill mutants --- .../src/Commands/Push/PushArtifactCommandTest.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php b/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php index 6c85126d5..4ad7dd063 100644 --- a/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php +++ b/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php @@ -24,9 +24,19 @@ protected function createCommand(): CommandBase return $this->injectCommand(PushArtifactCommand::class); } - public function testNoAuthenticationRequired(): void + public function testPushArtifactHelp(): void { $help = $this->command->getHelp(); + $expectedHelp = <<composer install, removing sensitive files, and committing vendor directories. + +Vendor directories and scaffold files are committed to the build artifact even if they are ignored in the source repository. + +To run additional build or sanitization steps (e.g. npm install), add a post-install-cmd script to your composer.json file: https://getcomposer.org/doc/articles/scripts.md#command-events + +This command is designed for a specific scenario in which there are two branches or repositories involved: a source branch without vendor files committed, and an artifact branch with them. If both your source and destination branches are the same, you should simply use git push instead. +EOF; + $this->assertEquals($expectedHelp, $help); $this->assertStringNotContainsString('This command requires authentication', $help); } From ce7f6b46742cfb6f3d3fd84095e54f9a537e32ed Mon Sep 17 00:00:00 2001 From: Dane Powell Date: Wed, 23 Oct 2024 13:24:00 -0700 Subject: [PATCH 3/3] fix --- tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php b/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php index 4ad7dd063..1a4cca06c 100644 --- a/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php +++ b/tests/phpunit/src/Commands/Push/PushArtifactCommandTest.php @@ -36,7 +36,7 @@ public function testPushArtifactHelp(): void This command is designed for a specific scenario in which there are two branches or repositories involved: a source branch without vendor files committed, and an artifact branch with them. If both your source and destination branches are the same, you should simply use git push instead. EOF; - $this->assertEquals($expectedHelp, $help); + self::assertStringContainsStringIgnoringLineEndings($expectedHelp, $help); $this->assertStringNotContainsString('This command requires authentication', $help); }