Merge remote-tracking branch 'origin/v4' into ijpatricio-wip-4
# Conflicts: # bootstrap/helpers.php # docker/dev/supervisord.conf
This commit is contained in:
@@ -46,7 +46,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
|
||||
@@ -55,7 +55,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