From 8d20960d3edca9f9e53d51002059b42f9cd60591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20L=C3=B8vgaard?= Date: Thu, 3 Oct 2024 13:46:06 +0200 Subject: [PATCH] Remove most of old test (we still need to migrate some assertions) --- tests/recipe/DeployTest.php | 50 --------------------------- tests/recipe/deploy.php | 44 ----------------------- tests/recipe/repository/.env | 5 --- tests/recipe/repository/README.md | 1 - tests/recipe/repository/composer.json | 9 ----- 5 files changed, 109 deletions(-) delete mode 100644 tests/recipe/deploy.php delete mode 100644 tests/recipe/repository/.env delete mode 100644 tests/recipe/repository/README.md delete mode 100644 tests/recipe/repository/composer.json diff --git a/tests/recipe/DeployTest.php b/tests/recipe/DeployTest.php index 8a0e0a3..ed3cab4 100644 --- a/tests/recipe/DeployTest.php +++ b/tests/recipe/DeployTest.php @@ -4,61 +4,11 @@ namespace Setono\Deployer\DotEnv\recipe; -use Deployer\Console\Application; -use Deployer\Deployer; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Tester\ApplicationTester; final class DeployTest extends TestCase { - private ApplicationTester $tester; - - private Deployer $deployer; - - public static function setUpBeforeClass(): void - { - set_include_path(get_include_path() . \PATH_SEPARATOR . __DIR__ . '/../../vendor/deployer/deployer'); - - // init repository - $repository = __DIR__ . '/repository'; - - exec("cd $repository && git init"); - exec("cd $repository && git add ."); - exec("cd $repository && git config user.name 'Joachim Løvgaard'"); - exec("cd $repository && git config user.email 'joachim@setono.com'"); - exec("cd $repository && git commit -m 'first commit'"); - } - - protected function setUp(): void - { - // init deployer and application tester0 - $console = new Application(); - $console->setAutoExit(false); - $this->tester = new ApplicationTester($console); - - $this->deployer = new Deployer($console); - Deployer::loadRecipe(__DIR__ . '/deploy.php'); - $this->deployer->init(); - } - - protected function tearDown(): void - { - foreach ($this->deployer->hosts as $host) { - $deployPath = $host->get('deploy_path'); - exec("rm -rf $deployPath"); - } - } - - public static function tearDownAfterClass(): void - { - $git = __DIR__ . '/repository/.git'; - exec("rm -rf $git"); - } - - /** - * @test - */ public function it_deploys(): void { $this->tester->run([ diff --git a/tests/recipe/deploy.php b/tests/recipe/deploy.php deleted file mode 100644 index 5963f7f..0000000 --- a/tests/recipe/deploy.php +++ /dev/null @@ -1,44 +0,0 @@ -set('deploy_path', __DIR__ . '/../../.build/deployer') -; - -// Tasks -desc('Deploy your project'); -task('deploy', [ - 'deploy:prepare', - 'deploy:lock', - 'deploy:release', - 'deploy:update_code', - 'deploy:shared', - 'deploy:writable', - 'deploy:vendors', - 'deploy:clear_paths', - 'deploy:symlink', - 'deploy:unlock', - 'deploy:cleanup', - 'deploy:success', -]); - -// If deploy fails automatically unlock - -fail('deploy_fail', 'deploy:unlock'); diff --git a/tests/recipe/repository/.env b/tests/recipe/repository/.env deleted file mode 100644 index ae6ba95..0000000 --- a/tests/recipe/repository/.env +++ /dev/null @@ -1,5 +0,0 @@ -ENV_VAR=value -ENV_VAR1=value -ENV_VAR2=value -ENV_VAR3=value - diff --git a/tests/recipe/repository/README.md b/tests/recipe/repository/README.md deleted file mode 100644 index 5c53106..0000000 --- a/tests/recipe/repository/README.md +++ /dev/null @@ -1 +0,0 @@ -# This is a fake repository used for testing diff --git a/tests/recipe/repository/composer.json b/tests/recipe/repository/composer.json deleted file mode 100644 index 7ae013f..0000000 --- a/tests/recipe/repository/composer.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "name": "setono/deployer-dotenv-test-repository", - "description": "composer.json needed for generating .env.local.php", - "license": "MIT", - "require": { - "symfony/dotenv": "^4.4 || ^5.0", - "symfony/flex": "^1.9" - } -}