Changes output to JSON serialization.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
use App\Actions\RemoteProcess\RunRemoteProcess;
|
||||
use App\Actions\RemoteProcess\TidyOutput;
|
||||
use App\Models\Server;
|
||||
use Database\Seeders\DatabaseSeeder;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
@@ -24,13 +23,10 @@ it('outputs correctly', function () {
|
||||
], $host);
|
||||
|
||||
|
||||
preg_match(RunRemoteProcess::MARK_REGEX, $activity->description, $matchesInRawContent);
|
||||
$out = (new TidyOutput($activity))();
|
||||
preg_match(RunRemoteProcess::MARK_REGEX, $out, $matchesInTidyOutput);
|
||||
|
||||
expect($matchesInRawContent)
|
||||
->not()->toBeEmpty()
|
||||
->and($matchesInTidyOutput)
|
||||
->toBeEmpty();
|
||||
$tidyOutput = RunRemoteProcess::decodeOutput($activity);
|
||||
|
||||
expect($tidyOutput)
|
||||
->toContain('Welcome 1 times')
|
||||
->toContain('Welcome 3 times')
|
||||
->not()->toBeJson();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user