Skip to content

Commit 327f439

Browse files
committed
WIP
Signed-off-by: Alexander Trauzzi <[email protected]>
1 parent 9e28846 commit 327f439

File tree

1 file changed

+25
-21
lines changed

1 file changed

+25
-21
lines changed

test/e2e/jobs/jobs.test.ts

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ limitations under the License.
1414
import { GenericContainer, Network, StartedNetwork, StartedTestContainer, TestContainers, Wait } from "testcontainers";
1515
// import { LogWaitStrategy } from "testcontainers/build/wait-strategies/log-wait-strategy";
1616
import { CommunicationProtocolEnum, DaprClient, DaprServer } from "../../../src";
17+
import { scheduler } from "node:timers/promises";
1718
// import { AbstractWaitStrategy } from "testcontainers/build/wait-strategies/wait-strategy";
1819

1920
jest.setTimeout(10000);
@@ -26,21 +27,6 @@ describe("Jobs End to End", () => {
2627
let server: DaprServer | null = null;
2728
let client: DaprClient | null = null;
2829

29-
function getIp(container: StartedTestContainer | null | undefined): string {
30-
31-
if (! network) throw new Error("Network is null or undefined?");
32-
if (! container) throw new Error("Container is null or undefined?");
33-
34-
return container.getIpAddress(network.getName());
35-
}
36-
37-
function getPort(container: StartedTestContainer | null | undefined, port: number): string {
38-
39-
if (! container) throw new Error("Container is null or undefined?");
40-
41-
return container.getMappedPort(port).toString();
42-
}
43-
4430
beforeAll(async () => {
4531

4632
await TestContainers.exposeHostPorts(8070);
@@ -54,13 +40,12 @@ describe("Jobs End to End", () => {
5440
.withExposedPorts(8083)
5541
.withCommand([
5642
"./scheduler",
57-
// "--listen-address", "0.0.0.0",
43+
// note: Don't think this is necessary, buuuuut????
44+
"--listen-address", "0.0.0.0",
5845
"--port", "8083",
59-
"--healthz-port", "8084",
60-
"--enable-metrics", "false",
61-
// note: This is here because `--enable-metrics=false` doesn't seem to be working.
62-
"--metrics-port", "8085",
6346
"--log-level", "debug",
47+
// note: This feels redundant, but here as yet another thing I've tried.
48+
// "--mode", "standalone",
6449
])
6550
.withTmpFs({
6651
"/data": "rw",
@@ -78,7 +63,7 @@ describe("Jobs End to End", () => {
7863
"./daprd",
7964
"--app-id", "dapr-js-sdk-testing",
8065
// todo: Need to figure out how to tell daprd where my app can be found as it's not on `localhost`
81-
// "--app-endpoint", "host.testcontainers.internal",
66+
"--app-channel-address", "host.testcontainers.internal",
8267
"--app-port", "8070",
8368
"--dapr-grpc-port", "8081",
8469
"--dapr-http-port", "8082",
@@ -90,6 +75,10 @@ describe("Jobs End to End", () => {
9075
.withWaitStrategy(Wait.forLogMessage("HTTP server is running on port").withStartupTimeout(10000))
9176
.start()
9277
;
78+
79+
console.info(`Scheduler: ${getIp(daprScheduler)}`);
80+
console.info(`Daemon: ${getIp(daprd)}`);
81+
9382
});
9483

9584
beforeEach(async () => {
@@ -159,4 +148,19 @@ describe("Jobs End to End", () => {
159148
value: "test",
160149
});
161150
});
151+
152+
function getIp(container: StartedTestContainer | null | undefined): string {
153+
154+
if (! network) throw new Error("Network is null or undefined?");
155+
if (! container) throw new Error("Container is null or undefined?");
156+
157+
return container.getIpAddress(network.getName());
158+
}
159+
160+
function getPort(container: StartedTestContainer | null | undefined, port: number): string {
161+
162+
if (! container) throw new Error("Container is null or undefined?");
163+
164+
return container.getMappedPort(port).toString();
165+
}
162166
})

0 commit comments

Comments
 (0)