wip
This commit is contained in:
@@ -15,7 +15,7 @@ it('starts a docker container correctly', function () {
|
||||
|
||||
// Assert there's no containers start with coolify_test_*
|
||||
$activity = remoteProcess([$areThereCoolifyTestContainers], $host);
|
||||
$containers = Output::containerList($activity->getExtraProperty('stdout'));
|
||||
$containers = formatDockerCmdOutputToJson($activity->getExtraProperty('stdout'));
|
||||
expect($containers)->toBeEmpty();
|
||||
|
||||
// start a container nginx -d --name = $containerName
|
||||
@@ -24,7 +24,7 @@ it('starts a docker container correctly', function () {
|
||||
|
||||
// docker ps name = $container
|
||||
$activity = remoteProcess([$areThereCoolifyTestContainers], $host);
|
||||
$containers = Output::containerList($activity->getExtraProperty('stdout'));
|
||||
$containers = formatDockerCmdOutputToJson($activity->getExtraProperty('stdout'));
|
||||
expect($containers->where('Names', $containerName)->count())->toBe(1);
|
||||
|
||||
// Stop testing containers
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Support;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
|
||||
class Output
|
||||
{
|
||||
public static function containerList($rawOutput): Collection
|
||||
{
|
||||
$outputLines = explode(PHP_EOL, $rawOutput);
|
||||
|
||||
return collect($outputLines)
|
||||
->reject(fn($line) => empty($line))
|
||||
->map(fn($outputLine) => json_decode($outputLine, flags: JSON_THROW_ON_ERROR));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user