Skip to content

Commit

Permalink
test(monitors): Batch monitors tests
Browse files Browse the repository at this point in the history
  • Loading branch information
szokeasaurusrex committed Nov 7, 2024
1 parent 2ffa30f commit 0f980bb
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 79 deletions.
34 changes: 34 additions & 0 deletions tests/integration/monitors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use crate::integration::{mock_endpoint, register_test, EndpointOptions};

#[test]
fn command_monitors() {
let _list_endpoint = mock_endpoint(
EndpointOptions::new("GET", "/api/0/organizations/wat-org/monitors/?cursor=", 200)
.with_response_file("monitors/get-monitors.json"),
);
let _envelope_endpoint =
mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200));
let _token_endpoint = mock_endpoint(
EndpointOptions::new("POST", "/api/0/monitors/foo-monitor/checkins/", 200)
.with_response_file("monitors/post-monitors.json"),
);

let cases = register_test("monitors/*.trycmd");

#[cfg(not(windows))]
cases.case("tests/integration/_cases/monitors/not_windows/*.trycmd");

#[cfg(windows)]
cases.case("tests/integration/_cases/monitors/windows/*.trycmd");
}

#[test]
fn command_monitors_run_server_error() {
let _server = mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 500));

#[cfg(not(windows))]
register_test("monitors/server_error/monitors-run-server-error.trycmd");

#[cfg(windows)]
register_test("monitors/server_error/monitors-run-server-error-win.trycmd");
}
15 changes: 0 additions & 15 deletions tests/integration/monitors/list.rs

This file was deleted.

14 changes: 0 additions & 14 deletions tests/integration/monitors/mod.rs

This file was deleted.

50 changes: 0 additions & 50 deletions tests/integration/monitors/run.rs

This file was deleted.

0 comments on commit 0f980bb

Please sign in to comment.