Skip to content

Commit cc37192

Browse files
test: Make tests pass with custom --target
Currently, some tests fail because they assert `target/debug/sentry-cli` as the path to the binary. This fails when running `cargo test` with a custom `--target`. Instead, let's stop asserting the path to the binary.
1 parent fd12de2 commit cc37192

File tree

7 files changed

+7
-7
lines changed

7 files changed

+7
-7
lines changed

tests/integration/_cases/bash_hook/bash_hook-release-env.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _sentry_err_trap() {
3737
echo "@exit_code:${_exit_code}" >> "$_SENTRY_TRACEBACK_FILE"
3838

3939
: >> "$_SENTRY_LOG_FILE"
40-
export SENTRY_LAST_EVENT=$([CWD]/target/debug/sentry-cli[EXE] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --release "0.2.0" --log "$_SENTRY_LOG_FILE" )
40+
export SENTRY_LAST_EVENT=$([..] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --release "0.2.0" --log "$_SENTRY_LOG_FILE" )
4141
rm -f "$_SENTRY_TRACEBACK_FILE" "$_SENTRY_LOG_FILE"
4242
}
4343

tests/integration/_cases/bash_hook/bash_hook-release.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _sentry_err_trap() {
3737
echo "@exit_code:${_exit_code}" >> "$_SENTRY_TRACEBACK_FILE"
3838

3939
: >> "$_SENTRY_LOG_FILE"
40-
export SENTRY_LAST_EVENT=$([CWD]/target/debug/sentry-cli[EXE] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --release "0.1.0" --log "$_SENTRY_LOG_FILE" )
40+
export SENTRY_LAST_EVENT=$([..] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --release "0.1.0" --log "$_SENTRY_LOG_FILE" )
4141
rm -f "$_SENTRY_TRACEBACK_FILE" "$_SENTRY_LOG_FILE"
4242
}
4343

tests/integration/_cases/bash_hook/bash_hook-tags.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _sentry_err_trap() {
3737
echo "@exit_code:${_exit_code}" >> "$_SENTRY_TRACEBACK_FILE"
3838

3939
: >> "$_SENTRY_LOG_FILE"
40-
export SENTRY_LAST_EVENT=$([CWD]/target/debug/sentry-cli[EXE] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --tag "example:value" --tag "example2:value2" --log "$_SENTRY_LOG_FILE" )
40+
export SENTRY_LAST_EVENT=$([..] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --tag "example:value" --tag "example2:value2" --log "$_SENTRY_LOG_FILE" )
4141
rm -f "$_SENTRY_TRACEBACK_FILE" "$_SENTRY_LOG_FILE"
4242
}
4343

tests/integration/_cases/bash_hook/bash_hook.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ _sentry_err_trap() {
3737
echo "@exit_code:${_exit_code}" >> "$_SENTRY_TRACEBACK_FILE"
3838

3939
: >> "$_SENTRY_LOG_FILE"
40-
export SENTRY_LAST_EVENT=$([CWD]/target/debug/sentry-cli[EXE] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --log "$_SENTRY_LOG_FILE" )
40+
export SENTRY_LAST_EVENT=$([..] bash-hook --send-event --traceback "$_SENTRY_TRACEBACK_FILE" --log "$_SENTRY_LOG_FILE" )
4141
rm -f "$_SENTRY_TRACEBACK_FILE" "$_SENTRY_LOG_FILE"
4242
}
4343

tests/integration/_cases/debug_files/debug_files-bundle_sources-mixed-embedded-sources.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $ sentry-cli --log-level=debug debug-files bundle-sources tests/integration/_fix
33
? success
44
INFO [..] Loaded config from [CWD]/.sentryclirc
55
DEBUG [..] sentry-cli version: [VERSION], platform: [..], architecture: [..]
6-
INFO [..] sentry-cli was invoked with the following command line: "[CWD]/target/debug/sentry-cli[EXE]" "--log-level=debug" "debug-files" "bundle-sources" "tests/integration/_fixtures/SrcGenSampleApp.pdb"
6+
INFO [..] sentry-cli was invoked with the following command line: "[..]" "--log-level=debug" "debug-files" "bundle-sources" "tests/integration/_fixtures/SrcGenSampleApp.pdb"
77
DEBUG [..] Trying to add source file: /Users/matt/Code/temp/SrcGenSampleApp/SrcGenSampleApp/Program.cs
88
DEBUG [..] Trying to add source file: /Users/matt/Code/temp/SrcGenSampleApp/SrcGenSampleApp/obj/Release/net6.0/SrcGenSampleApp.GlobalUsings.g.cs
99
DEBUG [..] Trying to add source file: /Users/matt/Code/temp/SrcGenSampleApp/SrcGenSampleApp/obj/Release/net6.0/.NETCoreApp,Version=v6.0.AssemblyAttributes.cs

tests/integration/_cases/send_envelope/send_envelope-file-log.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ $ sentry-cli send-envelope tests/integration/_fixtures/envelope.dat --log-level=
33
? success
44
INFO [..] Loaded config from [CWD]/.sentryclirc
55
DEBUG [..] sentry-cli version: [VERSION], platform: [..], architecture: [..]
6-
INFO [..] sentry-cli was invoked with the following command line: "[CWD]/target/debug/sentry-cli[EXE]" "send-envelope" "tests/integration/_fixtures/envelope.dat" "--log-level=debug"
6+
INFO [..] sentry-cli was invoked with the following command line: "[..]" "send-envelope" "tests/integration/_fixtures/envelope.dat" "--log-level=debug"
77
DEBUG [..] Sending envelope:
88
{"event_id":"22d00b3f-d1b1-4b5d-8d20-49d138cd8a9c"}
99
{"type":"event","length":74}

tests/integration/_cases/send_event/not_windows/send_event-raw.trycmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ $ sentry-cli send-event --log-level=debug
1515
? success
1616
INFO [..] Loaded config from [CWD]/.sentryclirc
1717
DEBUG [..] sentry-cli version: [VERSION], platform: [..], architecture: [..]
18-
INFO [..] sentry-cli was invoked with the following command line: "[CWD]/target/debug/sentry-cli[EXE]" "send-event" "--log-level=debug" "--level" "debug" "--timestamp" "1649335000929" "--release" "my-release" "--dist" "my-dist" "--env" "production" "--message" "hello" "--platform" "prod" "--tag" "hello:there" "--extra" "hello:there" "--user" "id:42" "--fingerprint" "custom-fingerprint" "--no-environ"
18+
INFO [..] sentry-cli was invoked with the following command line: "[..]" "send-event" "--log-level=debug" "--level" "debug" "--timestamp" "1649335000929" "--release" "my-release" "--dist" "my-dist" "--env" "production" "--message" "hello" "--platform" "prod" "--tag" "hello:there" "--extra" "hello:there" "--user" "id:42" "--fingerprint" "custom-fingerprint" "--no-environ"
1919
DEBUG [..] Sending envelope:
2020
{"event_id":"[..]"}
2121
{"type":"event","length":[..]}

0 commit comments

Comments
 (0)