-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from b13/feature/make-runtests
[FEATURE] Add command 'make:testing:setup'
- Loading branch information
Showing
17 changed files
with
868 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
$config = \TYPO3\CodingStandards\CsFixerConfig::create(); | ||
$config->getFinder()->exclude(['var']); | ||
$config->getFinder()->exclude(['var', 'Resources/Private/CodeTemplates']); | ||
return $config; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of TYPO3 CMS-based extension "b13/make" by b13. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
*/ | ||
|
||
namespace B13\Make\Command\Component; | ||
|
||
use B13\Make\Component\ComponentInterface; | ||
use B13\Make\Component\TestingSetup; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
|
||
/** | ||
* Command for creating docker based testing environment setup | ||
*/ | ||
class TestingSetupCommand extends SimpleComponentCommand | ||
{ | ||
/** | ||
* @var string $folder | ||
*/ | ||
protected $folder = ''; | ||
|
||
/** | ||
* @var string $file | ||
*/ | ||
protected $file; | ||
|
||
protected function configure(): void | ||
{ | ||
parent::configure(); | ||
$this->setDescription('Create a docker based testing environment setup'); | ||
} | ||
|
||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$this->showFlushCacheMessage = false; | ||
|
||
$this->file = 'runTests.sh'; | ||
$this->folder = 'Build/Scripts/'; | ||
parent::execute($input, $output); | ||
|
||
$this->file = 'docker-compose.yml'; | ||
$this->folder = 'Build/testing-docker/'; | ||
parent::execute($input, $output); | ||
|
||
$this->io->success( | ||
'The docker based testing environment setup is ready. You can enter the root directory of ' . | ||
$this->package->getPackageKey() . ' and execute: "bash Build/Scripts/runTests.sh -h"' | ||
); | ||
|
||
$this->io->note('Running specific test suits like "cgl" or "unit" requires installing the corresponding packages and configuration.'); | ||
|
||
return 0; | ||
} | ||
|
||
protected function createComponent(): ComponentInterface | ||
{ | ||
return (new TestingSetup($this->psr4Prefix)) | ||
->setExtensionKey($this->extensionKey) | ||
->setDirectory($this->folder) | ||
->setName($this->file); | ||
} | ||
|
||
protected function publishComponentConfiguration(ComponentInterface $component): bool | ||
{ | ||
// As we do not need to publish a configuration, we just return true | ||
return true; | ||
} | ||
|
||
protected function getAbsoluteComponentDirectory(ComponentInterface $component): string | ||
{ | ||
return $this->package->getPackagePath() . $this->folder; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/* | ||
* This file is part of TYPO3 CMS-based extension "b13/make" by b13. | ||
* | ||
* It is free software; you can redistribute it and/or modify it under | ||
* the terms of the GNU General Public License, either version 2 | ||
* of the License, or any later version. | ||
*/ | ||
|
||
namespace B13\Make\Component; | ||
|
||
/** | ||
* Testing environment component setup | ||
*/ | ||
class TestingSetup extends AbstractComponent | ||
{ | ||
/** @var string */ | ||
protected $extensionKey = ''; | ||
|
||
public function getExtensionKey(): string | ||
{ | ||
return $this->extensionKey; | ||
} | ||
|
||
public function setExtensionKey(string $extensionKey): self | ||
{ | ||
$this->extensionKey = $extensionKey; | ||
return $this; | ||
} | ||
|
||
public function setName(string $name): AbstractComponent | ||
{ | ||
$this->name = $name; | ||
return $this; | ||
} | ||
|
||
public function __toString(): string | ||
{ | ||
return $this->createFileContent( | ||
$this->getDirectory() . $this->getName(), | ||
[ | ||
'EXTENSION_KEY' => $this->getExtensionKey(), | ||
] | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.