-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Reference paths relative to project root #1800
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hubertdeng123
merged 24 commits into
getsentry:master
from
mll-lab:explicit-path-references
Feb 17, 2023
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
67b396b
Reference paths relative to the current script or project root
spawnia 734c80f
Fix codestyle
spawnia 227e4ba
Fix non-executables
spawnia 4f5d509
Fix codestyle
spawnia a2ea008
Fix custom-ca-roots test
spawnia 2ee767d
Fix log_path -> log_file
spawnia 1d59507
Update _unit-test/error-handling-test.sh
spawnia 7292db7
All paths relative to project root
spawnia 428a2c1
Quote jq arguments
spawnia 60c88c1
Debug in CI
spawnia ac90579
debug and hopefully pass
spawnia 32bac8d
Remove debug
spawnia 766a42e
Merge remote-tracking branch 'upstream/master' into explicit-path-ref…
spawnia 726ef54
Remove new usages of basedir
spawnia ea46ec8
Merge remote-tracking branch 'upstream/master' into explicit-path-ref…
spawnia 668f9e2
Merge branch 'master' into explicit-path-references
spawnia 4772621
Merge remote-tracking branch 'upstream/master' into explicit-path-ref…
spawnia b36c297
remove basedir, quote DOCKER_PLATFORM
spawnia 84adc23
avoid unnecessary loop
spawnia 34a5f20
actually build each service individually
spawnia 59a7bef
Merge branch 'master' into explicit-path-references
spawnia 2dcc03a
fix path to test files
spawnia e27906d
fix shellcheck errors
spawnia 0d8c0e0
Merge remote-tracking branch 'upstream/master' into explicit-path-ref…
spawnia File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,4 +1,3 @@ | ||
| #!/usr/bin/env bash | ||
| $dc rm -s -f -v fixture-custom-ca-roots | ||
| rm -f ../certificates/test-custom-ca-roots.crt ../sentry/test-custom-ca-roots.py | ||
| rm -f certificates/test-custom-ca-roots.crt sentry/test-custom-ca-roots.py | ||
| unset COMPOSE_FILE |
This file contains hidden or 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 hidden or 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 hidden or 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,9 +1,8 @@ | ||
| #!/usr/bin/env bash | ||
| set -ex | ||
|
|
||
| source "$(dirname $0)/../install/_lib.sh" | ||
|
|
||
| source ../install/dc-detect-version.sh | ||
| source install/_lib.sh | ||
| source install/dc-detect-version.sh | ||
|
|
||
| echo "${_group}Setting up variables and helpers ..." | ||
| export SENTRY_TEST_HOST="${SENTRY_TEST_HOST:-http://localhost:9000}" | ||
|
|
@@ -51,14 +50,14 @@ echo "${_endgroup}" | |
|
|
||
| echo "${_group}Running tests ..." | ||
| get_csrf_token() { awk '$6 == "sc" { print $7 }' $COOKIE_FILE; } | ||
| sentry_api_request() { curl -s -H 'Accept: application/json; charset=utf-8' -H "Referer: $SENTRY_TEST_HOST" -H 'Content-Type: application/json' -H "X-CSRFToken: $(get_csrf_token)" -b "$COOKIE_FILE" -c "$COOKIE_FILE" "$SENTRY_TEST_HOST/$1" ${@:2}; } | ||
| sentry_api_request() { curl -s -H 'Accept: application/json; charset=utf-8' -H "Referer: $SENTRY_TEST_HOST" -H 'Content-Type: application/json' -H "X-CSRFToken: $(get_csrf_token)" -b "$COOKIE_FILE" -c "$COOKIE_FILE" "$SENTRY_TEST_HOST/$1" "${@:2}"; } | ||
|
|
||
| login() { | ||
| INITIAL_AUTH_REDIRECT=$(curl -sL -o /dev/null $SENTRY_TEST_HOST -w %{url_effective}) | ||
| if [ "$INITIAL_AUTH_REDIRECT" != "$SENTRY_TEST_HOST/auth/login/sentry/" ]; then | ||
| echo "Initial /auth/login/ redirect failed, exiting..." | ||
| echo "$INITIAL_AUTH_REDIRECT" | ||
| exit -1 | ||
| exit 1 | ||
| fi | ||
|
|
||
| CSRF_TOKEN_FOR_LOGIN=$(curl $SENTRY_TEST_HOST -sL -c "$COOKIE_FILE" | awk -F "['\"]" ' | ||
|
|
@@ -78,7 +77,7 @@ declare -a LOGIN_TEST_STRINGS=( | |
| ) | ||
| for i in "${LOGIN_TEST_STRINGS[@]}"; do | ||
| echo "Testing '$i'..." | ||
| echo "$LOGIN_RESPONSE" | grep "$i[,}]" >&/dev/null | ||
| echo "$LOGIN_RESPONSE" | grep "${i}[,}]" >&/dev/null | ||
| echo "Pass." | ||
| done | ||
| echo "${_endgroup}" | ||
|
|
@@ -117,7 +116,7 @@ declare -a EVENT_TEST_STRINGS=( | |
| ) | ||
| for i in "${EVENT_TEST_STRINGS[@]}"; do | ||
| echo "Testing '$i'..." | ||
| echo "$EVENT_RESPONSE" | grep "$i[,}]" >&/dev/null | ||
| echo "$EVENT_RESPONSE" | grep "${i}[,}]" >&/dev/null | ||
| echo "Pass." | ||
| done | ||
| echo "${_endgroup}" | ||
|
|
@@ -145,16 +144,16 @@ SCOPES=$(jq -n -c --argjson scopes '["event:admin", "event:read", "member:read", | |
| SENTRY_AUTH_TOKEN=$(sentry_api_request "api/0/api-tokens/" -X POST --data "$SCOPES" | jq -r '.token') | ||
| SENTRY_DSN=$(sentry_api_request "api/0/projects/sentry/native/keys/" | jq -r '.[0].dsn.secret') | ||
| # Then upload the symbols to that project (note the container mounts pwd to /work) | ||
| SENTRY_URL="$SENTRY_TEST_HOST" sentry-cli upload-dif --org "$SENTRY_ORG" --project "$SENTRY_PROJECT" --auth-token "$SENTRY_AUTH_TOKEN" windows.sym | ||
| SENTRY_URL="$SENTRY_TEST_HOST" sentry-cli upload-dif --org "$SENTRY_ORG" --project "$SENTRY_PROJECT" --auth-token "$SENTRY_AUTH_TOKEN" _integration-test/windows.sym | ||
| # Get public key for minidump upload | ||
| PUBLIC_KEY=$(sentry_api_request "api/0/projects/sentry/native/keys/" | jq -r '.[0].public') | ||
| # Upload the minidump to be processed, this returns the event ID of the crash dump | ||
| EVENT_ID=$(sentry_api_request "api/$NATIVE_PROJECT_ID/minidump/?sentry_key=$PUBLIC_KEY" -X POST -F '[email protected]' | sed 's/\-//g') | ||
| EVENT_ID=$(sentry_api_request "api/$NATIVE_PROJECT_ID/minidump/?sentry_key=$PUBLIC_KEY" -X POST -F 'upload_file_minidump=@_integration-test/windows.dmp' | sed 's/\-//g') | ||
| # We have to wait for the item to be processed | ||
| for i in {0..60..10}; do | ||
| EVENT_PROCESSED=$(sentry_api_request "api/0/projects/$SENTRY_ORG/$SENTRY_PROJECT/events/" | jq -r '.[]|select(.id == "'"$EVENT_ID"'")|.id') | ||
| if [ -z "$EVENT_PROCESSED" ]; then | ||
| sleep $i | ||
| sleep "$i" | ||
| else | ||
| break | ||
| fi | ||
|
|
@@ -167,9 +166,9 @@ fi | |
| echo "${_endgroup}" | ||
|
|
||
| echo "${_group}Test custom CAs work ..." | ||
| source ./custom-ca-roots/setup.sh | ||
| source _integration-test/custom-ca-roots/setup.sh | ||
| $dcr --no-deps web python3 /etc/sentry/test-custom-ca-roots.py | ||
| source ./custom-ca-roots/teardown.sh | ||
| source _integration-test/custom-ca-roots/teardown.sh | ||
| echo "${_endgroup}" | ||
|
|
||
| # Table formatting based on https://stackoverflow.com/a/39144364 | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,16 +1,17 @@ | ||
| #!/usr/bin/env bash | ||
| source "$(dirname $0)/_test_setup.sh" | ||
|
|
||
| mmdb="../geoip/GeoLite2-City.mmdb" | ||
| source _unit-test/_test_setup.sh | ||
|
|
||
| mmdb=geoip/GeoLite2-City.mmdb | ||
|
|
||
| # Starts with no mmdb, ends up with empty. | ||
| test ! -f $mmdb | ||
| source geoip.sh | ||
| source install/geoip.sh | ||
| diff -rub $mmdb $mmdb.empty | ||
|
|
||
| # Doesn't clobber existing, though. | ||
| echo GARBAGE >$mmdb | ||
| source geoip.sh | ||
| source install/geoip.sh | ||
| test "$(cat $mmdb)" = "GARBAGE" | ||
|
|
||
| report_success |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.