Changes output to JSON serialization.

This commit is contained in:
Joao Patricio
2023-04-07 15:58:45 +01:00
parent 2a8d603f98
commit e6f0059e5e
10 changed files with 62 additions and 130 deletions

View File

@@ -1,5 +1,6 @@
<?php
use App\Actions\RemoteProcess\RunRemoteProcess;
use App\Actions\RemoteProcess\TidyOutput;
use App\Models\User;
use App\Models\Server;
@@ -38,7 +39,7 @@ it('starts a docker container correctly', function () {
// Assert there's no containers start with coolify_test_*
$activity = remoteProcess([$areThereCoolifyTestContainers], $host);
$tidyOutput = (new TidyOutput($activity))();
$tidyOutput = RunRemoteProcess::decodeOutput($activity);
$containers = formatDockerCmdOutputToJson($tidyOutput);
expect($containers)->toBeEmpty();
@@ -48,7 +49,7 @@ it('starts a docker container correctly', function () {
// docker ps name = $container
$activity = remoteProcess([$areThereCoolifyTestContainers], $host);
$tidyOutput = (new TidyOutput($activity))();
$tidyOutput = RunRemoteProcess::decodeOutput($activity);
$containers = formatDockerCmdOutputToJson($tidyOutput);
expect($containers->where('Names', $containerName)->count())->toBe(1);