@@ -14,6 +14,7 @@ limitations under the License.
14
14
import { GenericContainer , Network , StartedNetwork , StartedTestContainer , TestContainers , Wait } from "testcontainers" ;
15
15
// import { LogWaitStrategy } from "testcontainers/build/wait-strategies/log-wait-strategy";
16
16
import { CommunicationProtocolEnum , DaprClient , DaprServer } from "../../../src" ;
17
+ import { scheduler } from "node:timers/promises" ;
17
18
// import { AbstractWaitStrategy } from "testcontainers/build/wait-strategies/wait-strategy";
18
19
19
20
jest . setTimeout ( 10000 ) ;
@@ -26,21 +27,6 @@ describe("Jobs End to End", () => {
26
27
let server : DaprServer | null = null ;
27
28
let client : DaprClient | null = null ;
28
29
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
-
44
30
beforeAll ( async ( ) => {
45
31
46
32
await TestContainers . exposeHostPorts ( 8070 ) ;
@@ -54,13 +40,12 @@ describe("Jobs End to End", () => {
54
40
. withExposedPorts ( 8083 )
55
41
. withCommand ( [
56
42
"./scheduler" ,
57
- // "--listen-address", "0.0.0.0",
43
+ // note: Don't think this is necessary, buuuuut????
44
+ "--listen-address" , "0.0.0.0" ,
58
45
"--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" ,
63
46
"--log-level" , "debug" ,
47
+ // note: This feels redundant, but here as yet another thing I've tried.
48
+ // "--mode", "standalone",
64
49
] )
65
50
. withTmpFs ( {
66
51
"/data" : "rw" ,
@@ -78,7 +63,7 @@ describe("Jobs End to End", () => {
78
63
"./daprd" ,
79
64
"--app-id" , "dapr-js-sdk-testing" ,
80
65
// 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" ,
82
67
"--app-port" , "8070" ,
83
68
"--dapr-grpc-port" , "8081" ,
84
69
"--dapr-http-port" , "8082" ,
@@ -90,6 +75,10 @@ describe("Jobs End to End", () => {
90
75
. withWaitStrategy ( Wait . forLogMessage ( "HTTP server is running on port" ) . withStartupTimeout ( 10000 ) )
91
76
. start ( )
92
77
;
78
+
79
+ console . info ( `Scheduler: ${ getIp ( daprScheduler ) } ` ) ;
80
+ console . info ( `Daemon: ${ getIp ( daprd ) } ` ) ;
81
+
93
82
} ) ;
94
83
95
84
beforeEach ( async ( ) => {
@@ -159,4 +148,19 @@ describe("Jobs End to End", () => {
159
148
value : "test" ,
160
149
} ) ;
161
150
} ) ;
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
+ }
162
166
} )
0 commit comments