-
-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ref(api): Use EnvelopesApi instead of the sentry-core client (#2081)
Use sentry-cli's envelopes client, `EnvelopesApi`, instead of sentry-cores's `Client` method `send_envelope`. This change enables debug logging and non-zero exit codes for transmission failures like the other commands.
- Loading branch information
Showing
9 changed files
with
58 additions
and
56 deletions.
There are no files selected for viewing
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
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
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
3 changes: 1 addition & 2 deletions
3
tests/integration/_cases/monitors/monitors-run-token-auth-win.trycmd
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
3 changes: 1 addition & 2 deletions
3
tests/integration/_cases/monitors/monitors-run-token-auth.trycmd
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
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
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
"dist": "my-dist", | ||
"environment": "production", | ||
"message": "hello there" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,43 +1,52 @@ | ||
use crate::integration::{mock_endpoint, register_test, EndpointOptions}; | ||
use crate::integration::{self, EndpointOptions}; | ||
|
||
#[test] | ||
fn command_monitors_run() { | ||
let _server = | ||
integration::mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200)); | ||
if cfg!(windows) { | ||
register_test("monitors/monitors-run-win.trycmd"); | ||
integration::register_test("monitors/monitors-run-win.trycmd"); | ||
} else { | ||
register_test("monitors/monitors-run.trycmd"); | ||
integration::register_test("monitors/monitors-run.trycmd"); | ||
} | ||
} | ||
|
||
#[test] | ||
fn command_monitors_run_token_auth() { | ||
let _server = mock_endpoint( | ||
let _server = integration::mock_endpoint( | ||
EndpointOptions::new("POST", "/api/0/monitors/foo-monitor/checkins/", 200) | ||
.with_response_file("monitors/post-monitors.json"), | ||
); | ||
if cfg!(windows) { | ||
register_test("monitors/monitors-run-token-auth-win.trycmd").env("SENTRY_DSN", ""); | ||
integration::register_test("monitors/monitors-run-token-auth-win.trycmd") | ||
.env("SENTRY_DSN", ""); | ||
} else { | ||
register_test("monitors/monitors-run-token-auth.trycmd").env("SENTRY_DSN", ""); | ||
integration::register_test("monitors/monitors-run-token-auth.trycmd").env("SENTRY_DSN", ""); | ||
} | ||
} | ||
|
||
#[test] | ||
fn command_monitors_run_osenv() { | ||
register_test("monitors/monitors-run-osenv.trycmd"); | ||
let _server = | ||
integration::mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200)); | ||
integration::register_test("monitors/monitors-run-osenv.trycmd"); | ||
} | ||
|
||
#[test] | ||
fn command_monitors_run_environment() { | ||
register_test("monitors/monitors-run-environment.trycmd"); | ||
let _server = | ||
integration::mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200)); | ||
integration::register_test("monitors/monitors-run-environment.trycmd"); | ||
} | ||
|
||
#[test] | ||
fn command_monitors_run_environment_long() { | ||
register_test("monitors/monitors-run-environment-long.trycmd"); | ||
let _server = | ||
integration::mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200)); | ||
integration::register_test("monitors/monitors-run-environment-long.trycmd"); | ||
} | ||
|
||
#[test] | ||
fn command_monitors_run_help() { | ||
register_test("monitors/monitors-run-help.trycmd"); | ||
integration::register_test("monitors/monitors-run-help.trycmd"); | ||
} |
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 |
---|---|---|
@@ -1,21 +1,27 @@ | ||
use crate::integration::register_test; | ||
use crate::integration; | ||
|
||
use super::EndpointOptions; | ||
|
||
#[test] | ||
fn command_send_envelope_help() { | ||
register_test("send_envelope/send_envelope-help.trycmd"); | ||
integration::register_test("send_envelope/send_envelope-help.trycmd"); | ||
} | ||
|
||
#[test] | ||
fn command_send_envelope_no_file() { | ||
register_test("send_envelope/send_envelope-no-file.trycmd"); | ||
integration::register_test("send_envelope/send_envelope-no-file.trycmd"); | ||
} | ||
|
||
#[test] | ||
fn command_send_envelope_file() { | ||
register_test("send_envelope/send_envelope-file.trycmd"); | ||
let _server = | ||
integration::mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200)); | ||
integration::register_test("send_envelope/send_envelope-file.trycmd"); | ||
} | ||
|
||
#[test] | ||
fn command_send_envelope_with_logging() { | ||
register_test("send_envelope/send_envelope-file-log.trycmd"); | ||
let _server = | ||
integration::mock_endpoint(EndpointOptions::new("POST", "/api/1337/envelope/", 200)); | ||
integration::register_test("send_envelope/send_envelope-file-log.trycmd"); | ||
} |