-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker dev image, update README * fix phpunit execution with test matrix to avoid deprecation message caused by action * refactor tests for more stability, Galaxy was broken, vfs and process still broken * removed 8.0 support * remove post max size * workaround for proc_open behavior
- Loading branch information
Showing
14 changed files
with
218 additions
and
405 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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM php:8.3-cli | ||
|
||
ENV ANSIBLE_VERSION 2.9.17 | ||
|
||
# composer | ||
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | ||
&& php -r "if (hash_file('sha384', 'composer-setup.php') === 'dac665fdc30fdd8ec78b38b9800061b4150413ff2e3b6f88543c636f7cd84f6db9189d43a81e5503cda447da73c7e5b6') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \ | ||
&& php composer-setup.php \ | ||
&& php -r "unlink('composer-setup.php');" \ | ||
&& mv composer.phar /usr/bin/composer \ | ||
&& chmod +x /usr/bin/composer | ||
|
||
# python, pipx & ansible | ||
RUN apt-get update \ | ||
&& apt-get install -y gcc python3 git zip 7zip unzip pipx \ | ||
&& apt-get clean all; \ | ||
pipx install --upgrade pip; \ | ||
pipx install "ansible==${ANSIBLE_VERSION}"; \ | ||
pipx install ansible; | ||
|
||
# keep container running | ||
CMD [ "bash", "-c", "echo 'running'; tail -f /dev/null" ] |
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 |
---|---|---|
|
@@ -754,4 +754,4 @@ private function checkInventory(): void | |
$this->inventoryFile($inventory); | ||
} | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,26 +1,24 @@ | ||
<?php | ||
/* | ||
* This file is part of the php-ansible package. | ||
* | ||
* (c) Marc Aschmann <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Asm\Ansible; | ||
|
||
use Asm\Ansible\Exception\CommandException; | ||
use Asm\Ansible\Testing\AnsibleTestCase; | ||
use org\bovigo\vfs\vfsStream; | ||
use PHPUnit\Framework\Attributes\CoversClass; | ||
use PHPUnit\Framework\Attributes\CoversFunction; | ||
|
||
#[CoversClass(\Asm\Ansible\Ansible::class)] | ||
#[CoversFunction('playbook')] | ||
#[CoversFunction('createProcess')] | ||
#[CoversFunction('checkCommand')] | ||
#[CoversFunction('checkDir')] | ||
#[CoversFunction('__construct')] | ||
class AnsibleTest extends AnsibleTestCase | ||
{ | ||
/** | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
|
||
public function testInstance() | ||
{ | ||
$ansible = new Ansible( | ||
|
@@ -31,11 +29,6 @@ public function testInstance() | |
$this->assertInstanceOf('\Asm\Ansible\Ansible', $ansible, 'Instantiation with given paths'); | ||
} | ||
|
||
/** | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
public function testAnsibleProjectPathNotFoundException() | ||
{ | ||
$this->expectException(CommandException::class); | ||
|
@@ -46,11 +39,6 @@ public function testAnsibleProjectPathNotFoundException() | |
); | ||
} | ||
|
||
/** | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
public function testAnsibleCommandNotFoundException() | ||
{ | ||
$this->expectException(CommandException::class); | ||
|
@@ -61,11 +49,6 @@ public function testAnsibleCommandNotFoundException() | |
); | ||
} | ||
|
||
/** | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
public function testAnsibleNoCommandGivenException() | ||
{ | ||
// TODO: Not sure why the following command should give an error. | ||
|
@@ -75,11 +58,6 @@ public function testAnsibleNoCommandGivenException() | |
// ); | ||
} | ||
|
||
/** | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
public function testAnsibleCommandNotExecutableException() | ||
{ | ||
$this->expectException(CommandException::class); | ||
|
@@ -94,13 +72,6 @@ public function testAnsibleCommandNotExecutableException() | |
); | ||
} | ||
|
||
/** | ||
* @covers \Asm\Ansible\Ansible::playbook | ||
* @covers \Asm\Ansible\Ansible::createProcess | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
public function testPlaybookCommandInstance() | ||
{ | ||
$ansible = new Ansible( | ||
|
@@ -114,13 +85,6 @@ public function testPlaybookCommandInstance() | |
$this->assertInstanceOf('\Asm\Ansible\Command\AnsiblePlaybook', $playbook); | ||
} | ||
|
||
/** | ||
* @covers \Asm\Ansible\Ansible::galaxy | ||
* @covers \Asm\Ansible\Ansible::createProcess | ||
* @covers \Asm\Ansible\Ansible::checkCommand | ||
* @covers \Asm\Ansible\Ansible::checkDir | ||
* @covers \Asm\Ansible\Ansible::__construct | ||
*/ | ||
public function testGalaxyCommandInstance() | ||
{ | ||
$ansible = new Ansible( | ||
|
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
Oops, something went wrong.