mirror of
https://github.com/getsentry/self-hosted.git
synced 2025-12-08 19:46:14 +00:00
parent
7691addcb6
commit
746031dda4
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
@ -59,6 +59,8 @@ 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"
|
||||
@ -66,6 +68,8 @@ jobs:
|
||||
compose_path: "/usr/local/lib/docker/cli-plugins"
|
||||
env:
|
||||
COMPOSE_PROJECT_NAME: self-hosted-${{ strategy.job-index }}
|
||||
SENTRY_DSN: https://5a620019b5124cbba230a9e62db9b825@o1.ingest.us.sentry.io/6627632
|
||||
REPORT_SELF_HOSTED_ISSUES: 1
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
@ -82,8 +86,11 @@ 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: ./install.sh
|
||||
|
||||
- name: Integration Test
|
||||
run: ./integration-test.sh
|
||||
run: ./integration-test.sh --${{ matrix.test_type }}
|
||||
|
||||
- name: Inspect failure
|
||||
if: failure()
|
||||
|
||||
@ -1,50 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
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}"
|
||||
TEST_USER='test@example.com'
|
||||
TEST_PASS='test123TEST'
|
||||
COOKIE_FILE=$(mktemp)
|
||||
|
||||
# Courtesy of https://stackoverflow.com/a/2183063/90297
|
||||
trap_with_arg() {
|
||||
func="$1"
|
||||
shift
|
||||
for sig; do
|
||||
trap "$func $sig "'$LINENO' "$sig"
|
||||
done
|
||||
}
|
||||
|
||||
DID_TEAR_DOWN=0
|
||||
# the teardown function will be the exit point
|
||||
teardown() {
|
||||
if [ "$DID_TEAR_DOWN" -eq 1 ]; then
|
||||
return 0
|
||||
fi
|
||||
DID_TEAR_DOWN=1
|
||||
|
||||
if [ "$1" != "EXIT" ]; then
|
||||
echo "An error occurred, caught SIG$1 on line $2"
|
||||
fi
|
||||
|
||||
echo "Tearing down ..."
|
||||
rm $COOKIE_FILE
|
||||
echo "Done."
|
||||
}
|
||||
trap_with_arg teardown ERR INT TERM EXIT
|
||||
trap_with_arg cleanup ERR INT TERM EXIT
|
||||
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'
|
||||
# DC exec here is faster, tests run on the slower side and using exec would provide a boost
|
||||
echo y | $dc exec web sentry createuser --force-update --superuser --email $TEST_USER --password $TEST_PASS
|
||||
printf "Waiting for Sentry to be up"
|
||||
echo ""
|
||||
echo "${_endgroup}"
|
||||
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
echo "${_group}Setting up error handling ..."
|
||||
|
||||
export SENTRY_DSN='https://19555c489ded4769978daae92f2346ca@self-hosted.getsentry.net/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
|
||||
|
||||
@ -1,29 +1,40 @@
|
||||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
source install/_lib.sh
|
||||
source install/detect-platform.sh
|
||||
source install/dc-detect-version.sh
|
||||
source install/error-handling.sh
|
||||
|
||||
echo "Reset customizations"
|
||||
rm -f sentry/enhance-image.sh
|
||||
rm -f sentry/requirements.txt
|
||||
export REPORT_SELF_HOSTED_ISSUES=0
|
||||
|
||||
echo "Testing initial install"
|
||||
./install.sh
|
||||
_integration-test/run.sh
|
||||
_integration-test/ensure-customizations-not-present.sh
|
||||
_integration-test/ensure-backup-restore-works.sh
|
||||
test_option="$1"
|
||||
export MINIMIZE_DOWNTIME=0
|
||||
|
||||
echo "Make customizations"
|
||||
cat <<EOT >sentry/enhance-image.sh
|
||||
if [[ "$test_option" == "--initial-install" ]]; then
|
||||
echo "Testing initial install"
|
||||
source _integration-test/run.sh
|
||||
source _integration-test/ensure-customizations-not-present.sh
|
||||
source _integration-test/ensure-backup-restore-works.sh
|
||||
elif [[ "$test_option" == "--customizations" ]]; then
|
||||
echo "Testing customizations"
|
||||
$dc up -d
|
||||
echo "Making customizations"
|
||||
cat <<EOT >sentry/enhance-image.sh
|
||||
#!/bin/bash
|
||||
touch /created-by-enhance-image
|
||||
apt-get update
|
||||
apt-get install -y gcc libsasl2-dev python-dev libldap2-dev libssl-dev
|
||||
EOT
|
||||
chmod +x sentry/enhance-image.sh
|
||||
printf "python-ldap" >sentry/requirements.txt
|
||||
chmod +x sentry/enhance-image.sh
|
||||
printf "python-ldap" >sentry/requirements.txt
|
||||
|
||||
echo "Testing in-place upgrade and customizations"
|
||||
./install.sh --minimize-downtime
|
||||
_integration-test/run.sh
|
||||
_integration-test/ensure-customizations-work.sh
|
||||
_integration-test/ensure-backup-restore-works.sh
|
||||
echo "Testing in-place upgrade and customizations"
|
||||
export MINIMIZE_DOWNTIME=1
|
||||
./install.sh
|
||||
source _integration-test/run.sh
|
||||
source _integration-test/ensure-customizations-work.sh
|
||||
source _integration-test/ensure-backup-restore-works.sh
|
||||
fi
|
||||
|
||||
10
test.sh
10
test.sh
@ -1,6 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# This file runs in https://github.com/getsentry/sentry/blob/fe4795f5eae9e0d7c33e0ecb736c9d1369535eca/docker/cloudbuild.yaml#L59
|
||||
export MINIMIZE_DOWNTIME=0
|
||||
export REPORT_SELF_HOSTED_ISSUES=1
|
||||
|
||||
_integration-test/run.sh
|
||||
# This file runs in https://github.com/getsentry/sentry/blob/fe4795f5eae9e0d7c33e0ecb736c9d1369535eca/docker/cloudbuild.yaml#L59
|
||||
source install/_lib.sh
|
||||
source install/detect-platform.sh
|
||||
source install/dc-detect-version.sh
|
||||
source install/error-handling.sh
|
||||
source _integration-test/run.sh
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user