Skip to content

Port backup tests to python #3475

Port backup tests to python

Port backup tests to python #3475

Workflow file for this run

name: Test
on:
# Run CI on all pushes to the master and release/** branches, and on all new
# pull requests, and on all pushes to pull requests (even if a pull request
# is not against master).
push:
branches:
- "master"
- "release/**"
pull_request:
schedule:
- cron: "0 0,12 * * *"
defaults:
run:
shell: bash
jobs:
e2e-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-20.04
name: "Sentry self-hosted end-to-end tests"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: self-hosted
- name: Get Compose
run: |
# Always remove `docker compose` support as that's the newer version
# and comes installed by default nowadays.
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo mkdir -p "/usr/local/lib/docker/cli-plugins"
sudo curl -L https://github.com/docker/compose/releases/download/v2.7.0/docker-compose-`uname -s`-`uname -m` -o "/usr/local/lib/docker/cli-plugins/docker-compose"
sudo chmod +x "/usr/local/lib/docker/cli-plugins/docker-compose"
- name: End to end tests
uses: getsentry/action-self-hosted-e2e-tests@03010bd2963edc1f47b6e5e03167a4bc1433ea36
with:
project_name: self-hosted
unit-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-20.04
name: "unit tests"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Unit Tests
run: ./unit-test.sh
integration-test:
if: github.repository_owner == 'getsentry'
runs-on: ubuntu-20.04
name: "integration test"
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
REPORT_SELF_HOSTED_ISSUES: 1
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup dev environment
run: |
pip install -r requirements-dev.txt
### pytest-sentry configuration ###
if [ "$GITHUB_REPOSITORY" = "getsentry/self-hosted" ]; then
echo "PYTEST_SENTRY_DSN=${{ env.SELF_HOSTED_TESTING_DSN }}" >> $GITHUB_ENV
echo "PYTEST_SENTRY_TRACES_SAMPLE_RATE=0" >> $GITHUB_ENV
# This records failures on master to sentry in order to detect flakey tests, as it's
# expected that people have failing tests on their PRs
if [ "$GITHUB_REF" = "refs/heads/master" ]; then
echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV
fi
fi
- name: Get Compose
run: |
# Always remove `docker compose` support as that's the newer version
# and comes installed by default nowadays.
sudo rm -f "/usr/local/lib/docker/cli-plugins/docker-compose"
# Docker Compose v1 is installed here, remove it
sudo rm -f "/usr/local/bin/docker-compose"
sudo rm -f "${{ matrix.compose_path }}/docker-compose"
sudo mkdir -p "${{ matrix.compose_path }}"
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 --${{ matrix.test_type }}
- name: Inspect failure
if: failure()
run: |
docker compose ps
docker compose logs