Skip to content

Commit

Permalink
add test for command field
Browse files Browse the repository at this point in the history
  • Loading branch information
flamestro committed Jun 15, 2024
1 parent 33f49f4 commit 5ebe231
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,32 @@ describe('all', () => {
await snapshot(app, __dirname, 'service_command_string_array');
});

it('should compile service.command without escaping it', async () => {
const app = new App('Service.Command');

class TestComposition extends Composition {
constructor(id: string, props: CompositionProps) {
super(app, id, props);
new Service(this, 'Service', {
image: 'redis',
deploy: {
labels: {
['de.label']: 'label',
},
},
command: `-c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml; /app/console'`,
});
}
}

new TestComposition('Composition', {
version: '3.8',
name: 'composition',
});

await snapshot(app, __dirname, 'service_command_unescaped_string');
});

it('should compile service.healthcheck properly', async () => {
const app = new App('Service.Healthcheck');

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: "3.8"
name: "composition"
services:
Service.CommandCompositionService:
image: "redis"
deploy:
labels:
de.label: label
command: -c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml; /app/console'

0 comments on commit 5ebe231

Please sign in to comment.