fix(deploy): bound infrastructure container logs
This commit is contained in:
@@ -28,6 +28,11 @@ const composeFiles = [
|
||||
'deploy/docker-compose.overseas.yml',
|
||||
];
|
||||
|
||||
const infrastructureComposeFiles = [
|
||||
['deploy/docker-compose.rocketmq.yml', 3],
|
||||
['docker-compose-infra.yml', 3],
|
||||
];
|
||||
|
||||
test('deployable applications log only to stdout and stderr', () => {
|
||||
for (const path of applicationConfigs) {
|
||||
const source = readFileSync(path, 'utf8');
|
||||
@@ -52,3 +57,19 @@ test('runtime image does not prepare an application log directory', () => {
|
||||
const dockerfile = readFileSync('deploy/docker/Dockerfile', 'utf8');
|
||||
assert.doesNotMatch(dockerfile, /\/app\/logs/);
|
||||
});
|
||||
|
||||
test('infrastructure containers also use bounded local logs', () => {
|
||||
for (const [path, expectedServiceCount] of infrastructureComposeFiles) {
|
||||
const source = readFileSync(path, 'utf8');
|
||||
assert.match(source, /x-bounded-logging:\s+&bounded-logging/, path);
|
||||
assert.match(source, /driver:\s+local/, path);
|
||||
assert.match(source, /DOCKER_LOG_MAX_SIZE/, path);
|
||||
assert.match(source, /DOCKER_LOG_MAX_FILE/, path);
|
||||
assert.equal(
|
||||
source.match(/logging:\s+\*bounded-logging/g)?.length,
|
||||
expectedServiceCount,
|
||||
path,
|
||||
);
|
||||
assert.doesNotMatch(source, /driver:\s+json-file/, path);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user