fix: parser

ui: storage layout changed
This commit is contained in:
Andras Bacsai
2024-08-23 14:21:12 +02:00
parent 0f9076562f
commit af1b479d73
9 changed files with 1225 additions and 1276 deletions

View File

@@ -21,13 +21,11 @@ beforeEach(function () {
'APP_URL' => '$SERVICE_FQDN_APP',
],
'volumes' => [
'./:/var/www/html',
'./nginx:/etc/nginx',
'data:/var/www/html',
],
'depends_on' => [
'db' => [
'condition' => 'service_healthy',
],
'db',
],
],
'db' => [
@@ -45,6 +43,11 @@ beforeEach(function () {
'timeout' => '10s',
'retries' => 10,
],
'depends_on' => [
'app' => [
'condition' => 'service_healthy',
],
],
],
@@ -83,23 +86,12 @@ afterEach(function () {
test('ComposeParse', function () {
// expect($this->jsonComposeFile)->toBeJson()->ray();
$output = dockerComposeParserForApplications(
application: $this->application,
);
$output = $this->application->dockerComposeParser(pull_request_id: 1, preview_id: 77);
$outputOld = $this->application->parseCompose();
expect($output)->toBeInstanceOf(Collection::class)->ray();
expect($outputOld)->toBeInstanceOf(Collection::class)->ray();
expect($output)->toBeInstanceOf(Collection::class);
expect($outputOld)->toBeInstanceOf(Collection::class);
// Test if image is parsed correctly
$image = data_get_str($output, 'services.app.image');
expect($image->value())->toBe('nginx');
$imageOld = data_get_str($outputOld, 'services.app.image');
expect($image->value())->toBe($imageOld->value());
// Test environment variables are parsed correctly
$environment = data_get_str($output, 'services.app.environment');
$service_fqdn_app = data_get_str($environment, 'SERVICE_FQDN_APP');
ray(Yaml::dump($output->toArray(), 10, 2));
});