Skip to content

Commit

Permalink
Bump docker compose version in CI (#2980)
Browse files Browse the repository at this point in the history
* only rerun tests on v2.0.1

* change from http error to request error

* use 3 retries like before
  • Loading branch information
hubertdeng123 authored Apr 19, 2024
1 parent 082903c commit 3ead5cf
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ jobs:
fail-fast: false
matrix:
customizations: ["disabled", "enabled"]
compose_version: ["v2.0.1", "v2.7.0"]
compose_version: ["v2.0.1", "v2.26.0"]
include:
- compose_version: "v2.0.1"
compose_path: "/usr/local/lib/docker/cli-plugins"
- compose_version: "v2.7.0"
- compose_version: "v2.26.0"
compose_path: "/usr/local/lib/docker/cli-plugins"
env:
COMPOSE_PROJECT_NAME: self-hosted-${{ strategy.job-index }}
Expand Down Expand Up @@ -110,7 +110,12 @@ jobs:
command: ./install.sh

- name: Integration Test
run: pytest --cov --junitxml=junit.xml --reruns 3 _integration-test/ --customizations=${{ matrix.customizations }}
run: |
if [ "${{ matrix.compose_version }}" = "v2.0.1" ]; then
pytest --reruns 3 --cov --junitxml=junit.xml _integration-test/ --customizations=${{ matrix.customizations }}
else
pytest --cov --junitxml=junit.xml _integration-test/ --customizations=${{ matrix.customizations }}
fi
- name: Inspect failure
if: failure()
Expand Down
8 changes: 6 additions & 2 deletions _integration-test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@ def pytest_addoption(parser):

@pytest.fixture(scope="session", autouse=True)
def configure_self_hosted_environment(request):
subprocess.run(["docker", "compose", "--ansi", "never", "up", "-d"], check=True)
subprocess.run(
["docker", "compose", "--ansi", "never", "up", "-d"],
check=True,
capture_output=True,
)
for i in range(TIMEOUT_SECONDS):
try:
response = httpx.get(SENTRY_TEST_HOST, follow_redirects=True)
except httpx.NetworkError:
except httpx.RequestError:
time.sleep(1)
else:
if response.status_code == 200:
Expand Down
6 changes: 5 additions & 1 deletion _integration-test/test_backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def test_import(setup_backup_restore_env_variables):
["docker", "compose", "--ansi", "never", "run", "web", "upgrade", "--noinput"],
check=True,
)
subprocess.run(["docker", "compose", "--ansi", "never", "up", "-d"], check=True)
subprocess.run(
["docker", "compose", "--ansi", "never", "up", "-d"],
check=True,
capture_output=True,
)
sentry_admin_sh = os.path.join(os.getcwd(), "sentry-admin.sh")
subprocess.run(
[
Expand Down

0 comments on commit 3ead5cf

Please sign in to comment.