mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-21 11:49:59 +00:00
test: Add task runner to test containers (#19254)
This commit is contained in:
@@ -351,5 +351,44 @@ export async function setupProxyServer({
|
||||
}
|
||||
}
|
||||
|
||||
const TASK_RUNNER_IMAGE = 'n8nio/runners:nightly';
|
||||
|
||||
export async function setupTaskRunner({
|
||||
projectName,
|
||||
network,
|
||||
taskBrokerUri,
|
||||
}: {
|
||||
projectName: string;
|
||||
network: StartedNetwork;
|
||||
taskBrokerUri: string;
|
||||
}): Promise<StartedTestContainer> {
|
||||
const { consumer, throwWithLogs } = createSilentLogConsumer();
|
||||
|
||||
try {
|
||||
return await new GenericContainer(TASK_RUNNER_IMAGE)
|
||||
.withNetwork(network)
|
||||
.withNetworkAliases(`${projectName}-task-runner`)
|
||||
.withExposedPorts(5680)
|
||||
.withEnvironment({
|
||||
N8N_RUNNERS_AUTH_TOKEN: 'test',
|
||||
N8N_RUNNERS_LAUNCHER_LOG_LEVEL: 'debug',
|
||||
N8N_RUNNERS_TASK_BROKER_URI: taskBrokerUri,
|
||||
N8N_RUNNERS_MAX_CONCURRENCY: '5',
|
||||
N8N_RUNNERS_AUTO_SHUTDOWN_TIMEOUT: '15',
|
||||
})
|
||||
.withWaitStrategy(Wait.forListeningPorts())
|
||||
.withLabels({
|
||||
'com.docker.compose.project': projectName,
|
||||
'com.docker.compose.service': 'task-runner',
|
||||
})
|
||||
.withName(`${projectName}-task-runner`)
|
||||
.withReuse()
|
||||
.withLogConsumer(consumer)
|
||||
.start();
|
||||
} catch (error) {
|
||||
return throwWithLogs(error);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Look at Ollama container?
|
||||
// TODO: Look at MariaDB container?
|
||||
|
||||
Reference in New Issue
Block a user