Skip to content
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

Integration test improvements #2858

Merged
merged 11 commits into from
Mar 7, 2024
Prev Previous commit
Next Next commit
incorporate sentry dsn for testing into existing logic
  • Loading branch information
hubertdeng123 committed Mar 6, 2024
commit 4308b2cd484df8c2db31149999591d210815d7df
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ jobs:
compose_path: "/usr/local/lib/docker/cli-plugins"
env:
COMPOSE_PROJECT_NAME: self-hosted-${{ strategy.job-index }}
SENTRY_DSN: https://[email protected]/6627632
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -91,7 +92,7 @@ jobs:
timeout_minutes: 10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance this could actually increase the flake rate, due to timeouts becoming more frequent? Or are flakes caused by the actions itself timing out?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The typical install logic takes around 4-5 minutes. I doubled that time for the timeout so I don't think this should ever increase the flake rate.

retry_on: error
command: |
export REPORT_SELF_HOSTED_ISSUES=0
export REPORT_SELF_HOSTED_ISSUES=1
./install.sh

- name: Integration Test
Expand Down
7 changes: 1 addition & 6 deletions _integration-test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ teardown() {
DID_TEAR_DOWN=1

if [ "$1" != "EXIT" ]; then
set +x
error_msg="An error occurred, caught SIG$1 on line $2"
echo "$error_msg"
dsn="https://[email protected]/6627632"
local sentry_cli="docker run --rm -v $(pwd):/work -e SENTRY_DSN=$dsn getsentry/sentry-cli"
$sentry_cli send-event -m "$error_msg" --logfile $log_file
echo "An error occurred, caught SIG$1 on line $2"
fi

echo "Tearing down ..."
Expand Down
8 changes: 4 additions & 4 deletions install/error-handling.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
echo "${_group}Setting up error handling ..."

export SENTRY_DSN='https://[email protected]/3'
export SENTRY_ORG=self-hosted
export SENTRY_PROJECT=installer
if [ -z "${SENTRY_DSN:-}" ]; then
export SENTRY_DSN='https://19555c489ded4769978daae92f2346ca@self-hosted.getsentry.net/3'
fi

$dbuild -t sentry-self-hosted-jq-local --platform="$DOCKER_PLATFORM" jq

jq="docker run --rm -i sentry-self-hosted-jq-local"
sentry_cli="docker run --rm -v /tmp:/work -e SENTRY_ORG=$SENTRY_ORG -e SENTRY_PROJECT=$SENTRY_PROJECT -e SENTRY_DSN=$SENTRY_DSN getsentry/sentry-cli"
sentry_cli="docker run --rm -v /tmp:/work -e SENTRY_DSN=$SENTRY_DSN getsentry/sentry-cli"

send_envelope() {
# Send envelope
Expand Down
Loading