Skip to content

Commit b5fb947

Browse files
fix: adapt worker_api tests
1 parent 4889743 commit b5fb947

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

post-compute/src/api/worker_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ impl WorkerApiClient {
143143
chain_task_id: &str,
144144
exit_cause: &ExitMessage,
145145
) -> Result<(), ReplicateStatusCause> {
146-
let url = format!("{}/compute/post/{chain_task_id}/exit", self.base_url);
146+
let url = format!("{}/compute/post/{chain_task_id}/exit-causes", self.base_url);
147147
match self
148148
.client
149149
.post(&url)
@@ -325,7 +325,7 @@ mod tests {
325325
});
326326

327327
Mock::given(method("POST"))
328-
.and(path(format!("/compute/post/{CHAIN_TASK_ID}/exit")))
328+
.and(path(format!("/compute/post/{CHAIN_TASK_ID}/exit-causes")))
329329
.and(header("Authorization", CHALLENGE))
330330
.and(body_json(&expected_body))
331331
.respond_with(ResponseTemplate::new(200))
@@ -360,7 +360,7 @@ mod tests {
360360
let server_url = mock_server.uri();
361361

362362
Mock::given(method("POST"))
363-
.and(path(format!("/compute/post/{CHAIN_TASK_ID}/exit")))
363+
.and(path(format!("/compute/post/{CHAIN_TASK_ID}/exit-causes")))
364364
.respond_with(ResponseTemplate::new(404))
365365
.expect(1)
366366
.mount(&mock_server)

pre-compute/src/api/worker_api.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ mod tests {
220220
]);
221221

222222
Mock::given(method("POST"))
223-
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit")))
223+
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit-causes")))
224224
.and(header("Authorization", CHALLENGE))
225225
.and(body_json(&expected_body))
226226
.respond_with(ResponseTemplate::new(200))
@@ -250,7 +250,7 @@ mod tests {
250250
let server_url = mock_server.uri();
251251

252252
Mock::given(method("POST"))
253-
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit")))
253+
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit-causes")))
254254
.respond_with(ResponseTemplate::new(503).set_body_string("Service Unavailable"))
255255
.expect(1)
256256
.mount(&mock_server)
@@ -307,7 +307,7 @@ mod tests {
307307
assert_eq!(logs.len(), 1);
308308
assert_eq!(
309309
logs[0].body,
310-
"HTTP request failed when sending exit causes to wrong_url/compute/pre/0x123456789abcdef/exit: reqwest::Error { kind: Builder, source: RelativeUrlWithoutBase }"
310+
"HTTP request failed when sending exit causes to wrong_url/compute/pre/0x123456789abcdef/exit-causes: reqwest::Error { kind: Builder, source: RelativeUrlWithoutBase }"
311311
);
312312
});
313313
assert!(result.is_err());

pre-compute/src/compute/app_runner.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ mod pre_compute_start_with_app_tests {
191191
let mock_server = MockServer::start().await;
192192

193193
Mock::given(method("POST"))
194-
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit")))
194+
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit-causes")))
195195
.respond_with(ResponseTemplate::new(500))
196196
.mount(&mock_server)
197197
.await;
@@ -236,7 +236,7 @@ mod pre_compute_start_with_app_tests {
236236

237237
// Mock the worker API to return success
238238
Mock::given(method("POST"))
239-
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit")))
239+
.and(path(format!("/compute/pre/{CHAIN_TASK_ID}/exit-causes")))
240240
.and(body_json(expected_exit_message_payload))
241241
.respond_with(ResponseTemplate::new(200))
242242
.expect(1)

0 commit comments

Comments
 (0)