Skip to content

Commit c3b8193

Browse files
authored
Merge branch 'main' into LCORE-1472_e2e_retries
2 parents 1c6ed3d + 05607dd commit c3b8193

33 files changed

Lines changed: 71 additions & 33 deletions

.github/workflows/e2e_tests.yaml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ jobs:
1111
matrix:
1212
mode: ["server", "library"]
1313
environment: ["ci"]
14-
15-
name: "E2E: ${{ matrix.mode }} mode / ${{ matrix.environment }}"
14+
e2e_group: [1, 2, 3]
15+
16+
name: "E2E: ${{ matrix.mode }} mode / ${{ matrix.environment }} / group ${{ matrix.e2e_group }}"
1617

1718
env:
1819
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
@@ -103,6 +104,7 @@ jobs:
103104
echo "=== Configuration Summary ==="
104105
echo "Deployment mode: ${{ matrix.mode }}"
105106
echo "Environment: ${{ matrix.environment }}"
107+
echo "E2E shard (Makefile test-e2e-tagged): @e2e_group_${{ matrix.e2e_group }} (with not @skip)"
106108
echo "Source config: tests/e2e/configs/run-${{ matrix.environment }}.yaml"
107109
echo ""
108110
echo "=== Configuration Preview ==="
@@ -187,13 +189,15 @@ jobs:
187189
TERM: xterm-256color
188190
FORCE_COLOR: 1
189191
E2E_DEPLOYMENT_MODE: ${{ matrix.mode }}
192+
# Matches Makefile test-e2e-tagged / E2E_BEHAVE_TAG_EXPR (one @e2e_group_* per job).
193+
E2E_BEHAVE_TAG_EXPR: "not @skip and @e2e_group_${{ matrix.e2e_group }}"
190194
run: |
191195
echo "Installing test dependencies..."
192196
pip install uv
193197
uv sync
194198
195-
echo "Running comprehensive e2e test suite..."
196-
make test-e2e
199+
echo "Running e2e tests (E2E_BEHAVE_TAG_EXPR=${E2E_BEHAVE_TAG_EXPR})..."
200+
make test-e2e-tagged
197201
198202
- name: Show logs on failure
199203
if: failure()

Makefile

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ test-integration: ## Run integration tests tests
3232
test-e2e: ## Run end to end tests for the service
3333
script -q -e -c "uv run behave --color --format pretty --tags=-skip -D dump_errors=true @tests/e2e/test_list.txt"
3434

35-
test-e2e-local: ## Run end to end tests for the service
35+
test-e2e-local: ## Run end to end tests for the service (no script wrapper)
3636
uv run behave --color --format pretty --tags=-skip -D dump_errors=true @tests/e2e/test_list.txt
3737

38+
# Tag-based subsets (@e2e_group_* on feature files). Default runs all groups; override for one shard, e.g.
39+
# E2E_BEHAVE_TAG_EXPR='not @skip and @e2e_group_2' make test-e2e-tagged-local
40+
E2E_BEHAVE_TAG_EXPR ?= not @skip and (e2e_group_1 or e2e_group_2 or e2e_group_3)
41+
42+
test-e2e-tagged: ## Run e2e tests with E2E_BEHAVE_TAG_EXPR (default: all @e2e_group_*)
43+
script -q -e -c "uv run behave --color --format pretty --tags=\"$(E2E_BEHAVE_TAG_EXPR)\" -D dump_errors=true @tests/e2e/test_list.txt"
44+
45+
test-e2e-tagged-local: ## Same as test-e2e-tagged without script wrapper
46+
uv run behave --color --format pretty --tags="$(E2E_BEHAVE_TAG_EXPR)" -D dump_errors=true @tests/e2e/test_list.txt
47+
3848
benchmarks: ## Run benchmarks
3949
uv run python -m pytest -vv tests/benchmarks/
4050

tests/e2e/features/authorized_noop.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@e2e_group_1
12
Feature: Authorized endpoint API tests for the noop authentication module
23

34
Background:

tests/e2e/features/authorized_noop_token.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Authorized
1+
@e2e_group_2 @Authorized
22
Feature: Authorized endpoint API tests for the noop-with-token authentication module
33

44
Background:

tests/e2e/features/authorized_rh_identity.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@RHIdentity
1+
@e2e_group_3 @RHIdentity
22
Feature: Authorized endpoint API tests for the rh-identity authentication module
33

44
Background:

tests/e2e/features/conversation_cache_v2.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Authorized
1+
@e2e_group_2 @Authorized
22
Feature: Conversation Cache V2 API tests
33

44
Background:

tests/e2e/features/conversations.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Authorized
1+
@e2e_group_2 @Authorized
22
Feature: conversations endpoint API tests
33

44
Background:

tests/e2e/features/environment.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ def before_feature(context: Context, feature: Feature) -> None:
366366
``_E2E_FLAKY_MAX_ATTEMPTS`` and can be overridden with the
367367
``E2E_FLAKY_MAX_ATTEMPTS`` environment variable.
368368
"""
369+
setattr(feature, _E2E_FEATURE_PERF_START_ATTR, time.perf_counter())
369370
reset_active_lightspeed_stack_config_basename()
370371
context.active_lightspeed_stack_config_basename = None
371372
# One real Llama disruption per feature (module-level flag; survives context resets)
@@ -423,3 +424,19 @@ def after_feature(context: Context, feature: Feature) -> None:
423424

424425
_stop_proxy(context, "tunnel_proxy", "proxy_loop")
425426
_stop_proxy(context, "interception_proxy", "interception_proxy_loop")
427+
428+
start = getattr(feature, _E2E_FEATURE_PERF_START_ATTR, None)
429+
if start is not None:
430+
elapsed_s = time.perf_counter() - start
431+
try:
432+
delattr(feature, _E2E_FEATURE_PERF_START_ATTR)
433+
except AttributeError:
434+
pass
435+
feat_path = getattr(feature, "filename", "") or ""
436+
label = os.path.basename(feat_path) if feat_path else feature.name
437+
print(f"[e2e feature timing] {elapsed_s:.2f}s {label}", flush=True)
438+
439+
440+
# Behave captures hook stdout by default; output is only shown in some failure paths.
441+
# Disable capture so feature timing lines always appear on the real console/CI log.
442+
after_feature.capture = False # type: ignore[attr-defined]

tests/e2e/features/faiss.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Authorized
1+
@e2e_group_1 @Authorized
22
Feature: FAISS support tests
33

44
Background:

tests/e2e/features/feedback.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@Feedback
1+
@e2e_group_3 @Feedback
22
Feature: feedback endpoint API tests
33

44

0 commit comments

Comments
 (0)