mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-03 09:13:14 +00:00
Merge remote-tracking branch 'origin/main' into 11244-deprecated-docker-flags
This commit is contained in:
commit
4a7e77f809
15 files changed
+357
-10
No files matched your search
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Sentinel reports container memory `used` in bytes. The application metrics
|
||||
* chart labels those values as megabytes, so the series must be converted.
|
||||
*
|
||||
* @see https://github.com/coollabsio/coolify/issues/11246
|
||||
*/
|
||||
it('converts sentinel container memory samples from bytes to megabytes', function () {
|
||||
$metrics = [
|
||||
[1_700_000_000_000, 84_996_096.0],
|
||||
[1_700_000_005_000, 104_857_600.0],
|
||||
];
|
||||
|
||||
$converted = convertContainerMemoryBytesToMegabytes($metrics);
|
||||
|
||||
expect($converted)->toBe([
|
||||
[1_700_000_000_000, 81.06],
|
||||
[1_700_000_005_000, 100.0],
|
||||
]);
|
||||
});
|
||||
|
||||
it('preserves timestamps and converts a zero byte sample to zero megabytes', function () {
|
||||
expect(convertContainerMemoryBytesToMegabytes([
|
||||
[1_700_000_000_000, 0.0],
|
||||
]))->toBe([
|
||||
[1_700_000_000_000, 0.0],
|
||||
]);
|
||||
});
|
||||
|
||||
it('leaves an empty series unchanged', function () {
|
||||
expect(convertContainerMemoryBytesToMegabytes([]))->toBe([]);
|
||||
});
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
it('includes a Jean Server one-click service template with all deployment environment variables', function () {
|
||||
$compose = file_get_contents(__DIR__.'/../../templates/compose/jean.yaml');
|
||||
|
||||
expect($compose)
|
||||
->toContain('ghcr.io/coollabsio/jean-server:${JEAN_VERSION:-latest}')
|
||||
->toContain('SERVICE_URL_JEAN_3456')
|
||||
->toContain('JEAN_HEADLESS=${JEAN_HEADLESS:-1}')
|
||||
->toContain('JEAN_HOST=${JEAN_HOST:-0.0.0.0}')
|
||||
->toContain('JEAN_PORT=${JEAN_PORT:-3456}')
|
||||
->toContain('JEAN_TOKEN=${SERVICE_PASSWORD_64_JEAN}')
|
||||
->toContain('JEAN_NO_TOKEN=${JEAN_NO_TOKEN:-0}')
|
||||
->toContain('JEAN_ALLOW_UNSAFE_NO_TOKEN=${JEAN_ALLOW_UNSAFE_NO_TOKEN:-0}')
|
||||
->toContain('JEAN_ALLOW_NATIVE_OPEN=${JEAN_ALLOW_NATIVE_OPEN:-0}')
|
||||
->toContain('JEAN_ALLOWED_ORIGINS=${JEAN_ALLOWED_ORIGINS:-}')
|
||||
->toContain('JEAN_DATA_DIR=/home/jean/.local/share/com.jean.desktop')
|
||||
->toContain('jean-data:/home/jean/.local/share/com.jean.desktop')
|
||||
->toContain('http://127.0.0.1:3456/readyz');
|
||||
|
||||
foreach (['service-templates.json', 'service-templates-latest.json'] as $templateFile) {
|
||||
$templates = json_decode(
|
||||
file_get_contents(__DIR__."/../../templates/{$templateFile}"),
|
||||
associative: true,
|
||||
flags: JSON_THROW_ON_ERROR,
|
||||
);
|
||||
|
||||
expect($templates)->toHaveKey('jean');
|
||||
expect($templates['jean']['port'] ?? null)->toBe('3456');
|
||||
expect($templates['jean']['logo'] ?? null)->toBe('svgs/jean.png');
|
||||
expect($templates['jean']['category'] ?? null)->toBe('development');
|
||||
|
||||
$generatedCompose = base64_decode($templates['jean']['compose'], strict: true);
|
||||
|
||||
expect($generatedCompose)
|
||||
->toContain('ghcr.io/coollabsio/jean-server:${JEAN_VERSION:-latest}')
|
||||
->toContain('JEAN_TOKEN=${SERVICE_PASSWORD_64_JEAN}');
|
||||
}
|
||||
});
|
||||
Reference in new issue
Block a user