Skip to content

Commit

Permalink
Align args
Browse files Browse the repository at this point in the history
  • Loading branch information
ardatan committed Dec 18, 2024
1 parent 086b291 commit 585c3ff
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions internal/e2e/src/tenv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,16 @@ export function createTenv(cwd: string): Tenv {
subgraph = output;
}

const fullArgs = [
createPortOpt(port),
...(supergraph ? ['supergraph', supergraph] : []),
...(subgraph ? ['subgraph', subgraph] : []),
...args,
...(services?.map(({ name, port }) =>
createServicePortOpt(name, port),
) || []),
];

if (gatewayRunner === 'docker' || gatewayRunner === 'bun-docker') {
const volumes: ContainerOptions['volumes'] =
runner?.docker?.volumes || [];
Expand Down Expand Up @@ -468,15 +478,7 @@ export function createTenv(cwd: string): Tenv {
'CMD-SHELL',
`wget --spider http://0.0.0.0:${port}/healthcheck`,
],
cmd: [
createPortOpt(port),
...(supergraph ? ['supergraph', supergraph] : []),
...(subgraph ? ['subgraph', subgraph] : []),
...(services?.map(({ name, port }) =>
createServicePortOpt(name, port),
) || []),
...args,
],
cmd: [...fullArgs],
volumes,
pipeLogs,
});
Expand All @@ -487,13 +489,7 @@ export function createTenv(cwd: string): Tenv {
'npx',
'bun',
path.resolve(__project, 'packages', 'gateway', 'src', 'bin.ts'),
...(supergraph ? ['supergraph', supergraph] : []),
...(subgraph ? ['subgraph', subgraph] : []),
...(services?.map(({ name, port }) =>
createServicePortOpt(name, port),
) || []),
...args,
createPortOpt(port),
...fullArgs,
);
} /* if (gatewayRunner === 'node') */ else {
[proc, waitForExit] = await spawn(
Expand All @@ -502,13 +498,7 @@ export function createTenv(cwd: string): Tenv {
'--import',
'tsx',
path.resolve(__project, 'packages', 'gateway', 'src', 'bin.ts'),
...(supergraph ? ['supergraph', supergraph] : []),
...(subgraph ? ['subgraph', subgraph] : []),
...(services?.map(({ name, port }) =>
createServicePortOpt(name, port),
) || []),
...args,
createPortOpt(port),
...fullArgs,
);
}

Expand Down

0 comments on commit 585c3ff

Please sign in to comment.