-
-
Notifications
You must be signed in to change notification settings - Fork 222
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(monitors): Batch monitors tests
- Loading branch information
1 parent
2ffa30f
commit 0f980bb
Showing
8 changed files
with
34 additions
and
79 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.