@@ -16,7 +16,7 @@ defaults:
16
16
jobs :
17
17
e2e-test :
18
18
if : github.repository_owner == 'getsentry'
19
- runs-on : ubuntu-20 .04
19
+ runs-on : ubuntu-22 .04
20
20
name : " Sentry self-hosted end-to-end tests"
21
21
steps :
22
22
- name : Checkout
@@ -37,13 +37,13 @@ jobs:
37
37
sudo chmod +x "/usr/local/lib/docker/cli-plugins/docker-compose"
38
38
39
39
- name : End to end tests
40
- uses : getsentry/action-self-hosted-e2e-tests@03010bd2963edc1f47b6e5e03167a4bc1433ea36
40
+ uses : getsentry/action-self-hosted-e2e-tests@main
41
41
with :
42
42
project_name : self-hosted
43
43
44
44
unit-test :
45
45
if : github.repository_owner == 'getsentry'
46
- runs-on : ubuntu-20 .04
46
+ runs-on : ubuntu-22 .04
47
47
name : " unit tests"
48
48
steps :
49
49
- name : Checkout
@@ -54,12 +54,12 @@ jobs:
54
54
55
55
integration-test :
56
56
if : github.repository_owner == 'getsentry'
57
- runs-on : ubuntu-20 .04
58
- name : " integration test"
57
+ runs-on : ubuntu-22 .04
58
+ name : integration test ${{ matrix.compose_version }} - customizations ${{ matrix.customizations }}
59
59
strategy :
60
60
fail-fast : false
61
61
matrix :
62
- test_type : ["initial-install ", "customizations "]
62
+ customizations : ["disabled ", "enabled "]
63
63
compose_version : ["v2.0.1", "v2.7.0"]
64
64
include :
65
65
- compose_version : " v2.0.1"
@@ -68,12 +68,28 @@ jobs:
68
68
compose_path : " /usr/local/lib/docker/cli-plugins"
69
69
env :
70
70
COMPOSE_PROJECT_NAME : self-hosted-${{ strategy.job-index }}
71
- SENTRY_DSN : https://[email protected] /6627632
72
- REPORT_SELF_HOSTED_ISSUES : 1
71
+ REPORT_SELF_HOSTED_ISSUES : 0
72
+ SELF_HOSTED_TESTING_DSN : ${{ vars.SELF_HOSTED_TESTING_DSN }}
73
73
steps :
74
74
- name : Checkout
75
75
uses : actions/checkout@v4
76
76
77
+ - name : Setup dev environment
78
+ run : |
79
+ pip install -r requirements-dev.txt
80
+ echo "PY_COLORS=1" >> "$GITHUB_ENV"
81
+ ### pytest-sentry configuration ###
82
+ if [ "$GITHUB_REPOSITORY" = "getsentry/self-hosted" ]; then
83
+ echo "PYTEST_SENTRY_DSN=$SELF_HOSTED_TESTING_DSN" >> $GITHUB_ENV
84
+ echo "PYTEST_SENTRY_TRACES_SAMPLE_RATE=0" >> $GITHUB_ENV
85
+
86
+ # This records failures on master to sentry in order to detect flakey tests, as it's
87
+ # expected that people have failing tests on their PRs
88
+ if [ "$GITHUB_REF" = "refs/heads/master" ]; then
89
+ echo "PYTEST_SENTRY_ALWAYS_REPORT=1" >> $GITHUB_ENV
90
+ fi
91
+ fi
92
+
77
93
- name : Get Compose
78
94
run : |
79
95
# Always remove `docker compose` support as that's the newer version
@@ -87,13 +103,29 @@ jobs:
87
103
sudo chmod +x "${{ matrix.compose_path }}/docker-compose"
88
104
89
105
- name : Install self-hosted
90
- run : ./install.sh
106
+ uses : nick-fields/retry@v3
107
+ with :
108
+ timeout_minutes : 10
109
+ max_attempts : 3
110
+ command : ./install.sh
91
111
92
112
- name : Integration Test
93
- run : ./integration- test.sh --${{ matrix.test_type }}
113
+ run : pytest --cov --junitxml=junit.xml --reruns 3 _integration- test/ --customizations= ${{ matrix.customizations }}
94
114
95
115
- name : Inspect failure
96
116
if : failure()
97
117
run : |
98
118
docker compose ps
99
119
docker compose logs
120
+
121
+ - name : Upload coverage to Codecov
122
+ uses : codecov/codecov-action@v4
123
+ with :
124
+ token : ${{ secrets.CODECOV_TOKEN }}
125
+ slug : getsentry/self-hosted
126
+
127
+ - name : Upload test results to Codecov
128
+ if : ${{ !cancelled() }}
129
+ uses : codecov/test-results-action@v1
130
+ with :
131
+ token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments