-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Changes from 8 commits
02ccedd
07c059e
364d0d2
9dd9ac0
c21576f
4308b2c
b22f1eb
9c4fbfc
ffabc9f
2ced8fb
7559e55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,13 +59,16 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
matrix: | ||
test_type: ["initial-install", "customizations"] | ||
compose_version: ["v2.0.1", "v2.7.0"] | ||
include: | ||
- compose_version: "v2.0.1" | ||
compose_path: "/usr/local/lib/docker/cli-plugins" | ||
- compose_version: "v2.7.0" | ||
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 | ||
|
@@ -82,8 +85,13 @@ jobs: | |
sudo curl -L https://github.com/docker/compose/releases/download/${{ matrix.compose_version }}/docker-compose-`uname -s`-`uname -m` -o "${{ matrix.compose_path }}/docker-compose" | ||
sudo chmod +x "${{ matrix.compose_path }}/docker-compose" | ||
|
||
- name: Install self-hosted | ||
run: | | ||
export REPORT_SELF_HOSTED_ISSUES=1 | ||
./install.sh | ||
|
||
- name: Integration Test | ||
run: ./integration-test.sh | ||
run: ./integration-test.sh --${{ matrix.test_type }} | ||
|
||
- name: Inspect failure | ||
if: failure() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,10 +41,10 @@ echo "${_endgroup}" | |
echo "${_group}Starting Sentry for tests ..." | ||
# Disable beacon for e2e tests | ||
echo 'SENTRY_BEACON=False' >>$SENTRY_CONFIG_PY | ||
echo y | $dcr web createuser --force-update --superuser --email $TEST_USER --password $TEST_PASS | ||
$dc up -d | ||
printf "Waiting for Sentry to be up" | ||
timeout 90 bash -c 'until $(curl -Isf -o /dev/null $SENTRY_TEST_HOST); do printf '.'; sleep 0.5; done' | ||
echo y | $dc exec web sentry createuser --force-update --superuser --email $TEST_USER --password $TEST_PASS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens if we exec into the web container but it isn't ready yet? Does docker wait until it is ready, or does this fail? If it's the former, we should There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Docker compose up will only succeed if the container healthcheck for web passes, so I don't think this will be a problem. That is performed on a previous line, so when the tests get to the createuser logic the web container will always be ready |
||
printf "Waiting for Sentry to be up" | ||
echo "" | ||
echo "${_endgroup}" | ||
|
||
|
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docker run is slower than just an exec into a running container
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is but it is also intentional to keep the run separate from the main web process.
That said for a one-off thing like this, I think using
exec
is a good compromise if it saves a notable amount of time. I'd just want it documented with a brief comment.