72
72
load : true
73
73
cache-from : type=s3,prefix=cache/${{ github.repository }}/integration-tests/model-server/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
74
74
cache-to : type=s3,prefix=cache/${{ github.repository }}/integration-tests/model-server/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max
75
-
75
+
76
76
- name : Build integration test Docker image
77
77
uses : ./.github/actions/custom-build-and-push
78
78
with :
85
85
cache-from : type=s3,prefix=cache/${{ github.repository }}/integration-tests/integration/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }}
86
86
cache-to : type=s3,prefix=cache/${{ github.repository }}/integration-tests/integration/,region=${{ env.RUNS_ON_AWS_REGION }},bucket=${{ env.RUNS_ON_S3_BUCKET_CACHE }},mode=max
87
87
88
- - name : Start Docker containers
88
+ # Start containers for multi-tenant tests
89
+ - name : Start Docker containers for multi-tenant tests
90
+ run : |
91
+ cd deployment/docker_compose
92
+ ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true \
93
+ MULTI_TENANT=true \
94
+ AUTH_TYPE=basic \
95
+ REQUIRE_EMAIL_VERIFICATION=false \
96
+ DISABLE_TELEMETRY=true \
97
+ IMAGE_TAG=test \
98
+ docker compose -f docker-compose.dev.yml -p danswer-stack up -d
99
+ id : start_docker_multi_tenant
100
+
101
+ # In practice, `cloud` Auth type would require OAUTH credentials to be set.
102
+ - name : Run Multi-Tenant Integration Tests
103
+ run : |
104
+ echo "Running integration tests..."
105
+ docker run --rm --network danswer-stack_default \
106
+ --name test-runner \
107
+ -e POSTGRES_HOST=relational_db \
108
+ -e POSTGRES_USER=postgres \
109
+ -e POSTGRES_PASSWORD=password \
110
+ -e POSTGRES_DB=postgres \
111
+ -e VESPA_HOST=index \
112
+ -e REDIS_HOST=cache \
113
+ -e API_SERVER_HOST=api_server \
114
+ -e OPENAI_API_KEY=${OPENAI_API_KEY} \
115
+ -e SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN} \
116
+ -e TEST_WEB_HOSTNAME=test-runner \
117
+ -e AUTH_TYPE=cloud \
118
+ -e MULTI_TENANT=true \
119
+ danswer/danswer-integration:test \
120
+ /app/tests/integration/multitenant_tests
121
+ continue-on-error : true
122
+ id : run_multitenant_tests
123
+
124
+ - name : Check multi-tenant test results
125
+ run : |
126
+ if [ ${{ steps.run_tests.outcome }} == 'failure' ]; then
127
+ echo "Integration tests failed. Exiting with error."
128
+ exit 1
129
+ else
130
+ echo "All integration tests passed successfully."
131
+ fi
132
+
133
+ - name : Stop multi-tenant Docker containers
134
+ run : |
135
+ cd deployment/docker_compose
136
+ docker compose -f docker-compose.dev.yml -p danswer-stack down -v
137
+
138
+
139
+ - name : Start Docker containers
89
140
run : |
90
141
cd deployment/docker_compose
91
142
ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true \
@@ -130,7 +181,7 @@ jobs:
130
181
done
131
182
echo "Finished waiting for service."
132
183
133
- - name : Run integration tests
184
+ - name : Run Standard Integration Tests
134
185
run : |
135
186
echo "Running integration tests..."
136
187
docker run --rm --network danswer-stack_default \
@@ -145,7 +196,8 @@ jobs:
145
196
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
146
197
-e SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN} \
147
198
-e TEST_WEB_HOSTNAME=test-runner \
148
- danswer/danswer-integration:test
199
+ danswer/danswer-integration:test \
200
+ /app/tests/integration/tests
149
201
continue-on-error : true
150
202
id : run_tests
151
203
@@ -158,6 +210,11 @@ jobs:
158
210
echo "All integration tests passed successfully."
159
211
fi
160
212
213
+ - name : Stop Docker containers
214
+ run : |
215
+ cd deployment/docker_compose
216
+ docker compose -f docker-compose.dev.yml -p danswer-stack down -v
217
+
161
218
- name : Save Docker logs
162
219
if : success() || failure()
163
220
run : |
0 commit comments