4646 timeout-minutes : 45
4747 outputs :
4848 test-dirs : ${{ steps.set-matrix.outputs.test-dirs }}
49+ editions : ${{ steps.set-editions.outputs.editions }}
4950 steps :
5051 - name : Checkout code
5152 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # ratchet:actions/checkout@v6
7273 all_dirs="[${all_dirs%,}]"
7374 echo "test-dirs=$all_dirs" >> $GITHUB_OUTPUT
7475
76+ - name : Determine editions to test
77+ id : set-editions
78+ run : |
79+ # On PRs, only run EE tests. On merge_group and tags, run both EE and MIT.
80+ if [ "${{ github.event_name }}" = "pull_request" ]; then
81+ echo 'editions=["ee"]' >> $GITHUB_OUTPUT
82+ else
83+ echo 'editions=["ee","mit"]' >> $GITHUB_OUTPUT
84+ fi
85+
7586 build-backend-image :
7687 runs-on :
7788 [
@@ -267,14 +278,15 @@ jobs:
267278 runs-on :
268279 - runs-on
269280 - runner=4cpu-linux-arm64
270- - ${{ format('run-id={0}-integration-tests-job-{1 }', github.run_id, strategy['job-index']) }}
281+ - ${{ format('run-id={0}-integration-tests-{1}- job-{2 }', github.run_id, matrix.edition , strategy['job-index']) }}
271282 - extras=ecr-cache
272283 timeout-minutes : 45
273284
274285 strategy :
275286 fail-fast : false
276287 matrix :
277288 test-dir : ${{ fromJson(needs.discover-test-dirs.outputs.test-dirs) }}
289+ edition : ${{ fromJson(needs.discover-test-dirs.outputs.editions) }}
278290
279291 steps :
280292 - uses : runs-on/action@cd2b598b0515d39d78c38a02d529db87d2196d1e # ratchet:runs-on/action@v2
@@ -298,12 +310,11 @@ jobs:
298310 env :
299311 ECR_CACHE : ${{ env.RUNS_ON_ECR_CACHE }}
300312 RUN_ID : ${{ github.run_id }}
313+ EDITION : ${{ matrix.edition }}
301314 run : |
315+ # Base config shared by both editions
302316 cat <<EOF > deployment/docker_compose/.env
303317 COMPOSE_PROFILES=s3-filestore
304- ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true
305- # TODO(Nik): https://linear.app/onyx-app/issue/ENG-1/update-test-infra-to-use-test-license
306- LICENSE_ENFORCEMENT_ENABLED=false
307318 AUTH_TYPE=basic
308319 POSTGRES_POOL_PRE_PING=true
309320 POSTGRES_USE_NULL_POOL=true
@@ -312,11 +323,20 @@ jobs:
312323 ONYX_BACKEND_IMAGE=${ECR_CACHE}:integration-test-backend-test-${RUN_ID}
313324 ONYX_MODEL_SERVER_IMAGE=${ECR_CACHE}:integration-test-model-server-test-${RUN_ID}
314325 INTEGRATION_TESTS_MODE=true
315- CHECK_TTL_MANAGEMENT_TASK_FREQUENCY_IN_HOURS=0.001
316- AUTO_LLM_UPDATE_INTERVAL_SECONDS=10
317326 MCP_SERVER_ENABLED=true
327+ AUTO_LLM_UPDATE_INTERVAL_SECONDS=10
328+ EOF
329+
330+ # EE-only config
331+ if [ "$EDITION" = "ee" ]; then
332+ cat <<EOF >> deployment/docker_compose/.env
333+ ENABLE_PAID_ENTERPRISE_EDITION_FEATURES=true
334+ # TODO(Nik): https://linear.app/onyx-app/issue/ENG-1/update-test-infra-to-use-test-license
335+ LICENSE_ENFORCEMENT_ENABLED=false
336+ CHECK_TTL_MANAGEMENT_TASK_FREQUENCY_IN_HOURS=0.001
318337 USE_LIGHTWEIGHT_BACKGROUND_WORKER=false
319338 EOF
339+ fi
320340
321341 - name : Start Docker containers
322342 run : |
@@ -379,14 +399,14 @@ jobs:
379399 docker compose -f docker-compose.mock-it-services.yml \
380400 -p mock-it-services-stack up -d
381401
382- - name : Run Integration Tests for ${{ matrix.test-dir.name }}
402+ - name : Run Integration Tests (${{ matrix.edition }}) for ${{ matrix.test-dir.name }}
383403 uses : nick-fields/retry@ce71cc2ab81d554ebbe88c79ab5975992d79ba08 # ratchet:nick-fields/retry@v3
384404 with :
385405 timeout_minutes : 20
386406 max_attempts : 3
387407 retry_wait_seconds : 10
388408 command : |
389- echo "Running integration tests for ${{ matrix.test-dir.path }}..."
409+ echo "Running ${{ matrix.edition }} integration tests for ${{ matrix.test-dir.path }}..."
390410 docker run --rm --network onyx_default \
391411 --name test-runner \
392412 -e POSTGRES_HOST=relational_db \
@@ -444,7 +464,7 @@ jobs:
444464 if : always()
445465 uses : actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
446466 with :
447- name : docker-all-logs-${{ matrix.test-dir.name }}
467+ name : docker-all-logs-${{ matrix.edition }}-${{ matrix. test-dir.name }}
448468 path : ${{ github.workspace }}/docker-compose.log
449469 # ------------------------------------------------------------
450470
0 commit comments