Skip to content

Commit f746fad

Browse files
Merge pull request #493 from JoaoFula/implement-OLS-3749
OLS-3749 - add troubleshooting tests to product e2e
2 parents bc830ee + 0014a7a commit f746fad

10 files changed

Lines changed: 1163 additions & 50 deletions

File tree

‎.tekton/integration-tests/pipelines/agentic-product-e2e-pipeline.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,14 @@ spec:
181181
value: "/var/run/credentials/vertex/token"
182182
- name: VERTEX_PROJECT_ID
183183
value: "openshift-lightspeed-tests"
184+
- name: VERTEX_REGION
185+
value: "global"
184186
- name: OPENAI_PROVIDER_KEY_PATH
185187
value: "/var/run/credentials/openai/token"
186188
- name: ARTIFACT_DIR
187189
value: "/workspace/konflux-artifacts"
190+
- name: E2E_SCENARIO_TAGS
191+
value: "alert"
188192
image: registry.redhat.io/openshift4/ose-cli:latest
189193
script: |
190194
set -euo pipefail

‎.tekton/integration-tests/scripts/install-operator.sh‎

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,23 +60,6 @@ fi
6060
echo "Deploying operator..."
6161
make deploy IMG="${IMG}" OPERATOR_NAMESPACE="${OPERATOR_NAMESPACE}" SANDBOX_MODE="${SANDBOX_MODE}"
6262

63-
# Grant cluster-admin to operator SA (same as quickstart — covers escalation + SCC).
64-
echo "Granting cluster-admin to operator SA..."
65-
oc apply -f - <<EOF
66-
apiVersion: rbac.authorization.k8s.io/v1
67-
kind: ClusterRoleBinding
68-
metadata:
69-
name: lightspeed-agentic-operator-admin
70-
roleRef:
71-
apiGroup: rbac.authorization.k8s.io
72-
kind: ClusterRole
73-
name: cluster-admin
74-
subjects:
75-
- kind: ServiceAccount
76-
name: controller-manager
77-
namespace: ${OPERATOR_NAMESPACE}
78-
EOF
79-
8063
# Grant cluster-reader to agent SA (required by execution RBAC discovery).
8164
echo "Granting cluster-reader to agent SA..."
8265
oc apply -f - <<EOF

‎README.md‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,43 @@ make api-lint # Kube API linter on api/ (golangci-lint custom + plugin; se
139139

140140
**`make test-e2e`** runs **`go test -tags=e2e ./test/e2e/...`** against a live cluster with the operator running. Prerequisites: **`make run TEMPLATE_NAME=lightspeed-agent-mock`** (or deployed operator with **`--template-name=lightspeed-agent-mock`**) and mock agent SandboxTemplate applied (**`kubectl apply -k test/agent/sandboxtemplate`**). See `test/e2e/` package doc for details.
141141

142+
### Product E2E (real providers)
143+
144+
Product E2E runs the troubleshooting scenarios against a real LLM provider. It deploys (or reuses) the operator, clones `rhobs/troubleshooting-scenarios`, and runs the `product_e2e`-tagged tests. For example, to run Claude scenarios:
145+
146+
```bash
147+
IMG=quay.io/.../lightspeed-agentic-operator@sha256:<digest> \
148+
VERTEX_PROVIDER_KEY_PATH=/path/to/service-account.json \
149+
VERTEX_PROJECT_ID=my-gcp-project \
150+
ARTIFACT_DIR="$PWD/artifacts" \
151+
bash scripts/e2e-cluster.sh claude
152+
```
153+
154+
`claude` and `gemini` require `VERTEX_PROVIDER_KEY_PATH` and `VERTEX_PROJECT_ID`; `openai` requires `OPENAI_PROVIDER_KEY_PATH`. The runner accepts one or more providers (`claude`, `gemini`, and/or `openai`).
155+
156+
| Variable | Purpose |
157+
|---|---|
158+
| `E2E_SCENARIO_TAGS=alert` | Run scenarios carrying the `alert` tag instead of the default `core` tag. Multiple tags are an **AND** filter: `core,alert` requires both. |
159+
| `E2E_SKIP_SCENARIOS=pending_pvc_alert` | Skip comma-separated scenario directory names. |
160+
| `E2E_SCENARIO_TIMEOUT=20m` | Per-scenario deadline (default: `20m`). |
161+
| `E2E_OTEL_ENABLED=false` | Disable the persistent OTEL/Postgres collector used for product-E2E artifacts. It is enabled by default. |
162+
| `E2E_OTEL_IMAGE=quay.io/.../collector:tag` | Override the OTEL collector image. |
163+
| `ARTIFACT_DIR=/path/to/artifacts` | Directory where test and diagnostic artifacts are written. |
164+
165+
With `ARTIFACT_DIR` set, artifacts are arranged per provider:
166+
167+
```text
168+
artifacts/<provider>/
169+
├── product-e2e-output.log # Go test output
170+
├── operator-logs.txt # controller-manager logs
171+
├── pods.yaml # remaining operator-namespace pods
172+
├── podlogs/ # best-effort direct sandbox-pod log backup
173+
└── runs/<run-name>/
174+
└── otel-sandbox.json # persisted OTEL collector records for the run
175+
```
176+
177+
The runner configures the collector with its Postgres backend, because the default `nop` pipeline drops records and does not expose the admin API used to export per-run records. Direct pod-log capture is best effort: sandbox pods may be removed immediately after completion, so persisted OTEL records are the primary diagnostic source.
178+
142179
For noisy debugging: **`go test ./controller/agenticrun/... -v`**, **`go test ./api/... -v`**, **`go test ./cli/... -v`**.
143180

144181
### API lint (Kube API linter)

‎go.mod‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ require (
1515
go.uber.org/zap v1.28.0
1616
gomodules.xyz/jsonpatch/v2 v2.5.0
1717
google.golang.org/grpc v1.83.2
18+
gopkg.in/yaml.v3 v3.0.1
1819
k8s.io/api v0.35.3
1920
k8s.io/apiextensions-apiserver v0.35.3
2021
k8s.io/apimachinery v0.35.3
@@ -65,15 +66,18 @@ require (
6566
github.com/google/btree v1.1.3 // indirect
6667
github.com/google/gnostic-models v0.7.1 // indirect
6768
github.com/google/uuid v1.6.0 // indirect
69+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect
6870
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect
6971
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7072
github.com/json-iterator/go v1.1.12 // indirect
7173
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de // indirect
74+
github.com/moby/spdystream v0.5.1 // indirect
7275
github.com/moby/term v0.5.2 // indirect
7376
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
7477
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
7578
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
7679
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
80+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
7781
github.com/peterbourgon/diskv v2.0.1+incompatible // indirect
7882
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
7983
github.com/prometheus/client_golang v1.24.1 // indirect

‎go.sum‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c h1:udKWzYgxTojEK
22
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
33
github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0=
44
github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM=
5+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
6+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
57
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
68
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
79
github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM=
@@ -87,6 +89,8 @@ github.com/google/pprof v0.0.0-20250403155104-27863c87afa6 h1:BHT72Gu3keYf3ZEu2J
8789
github.com/google/pprof v0.0.0-20250403155104-27863c87afa6/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
8890
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
8991
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
92+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo=
93+
github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA=
9094
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79 h1:+ngKgrYPPJrOjhax5N+uePQ0Fh1Z7PheYoUI/0nzkPA=
9195
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
9296
github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw=
@@ -97,10 +101,18 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr
97101
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
98102
github.com/klauspost/compress v1.19.1 h1:VsB4HPswih7mmZ8WleSFQ75c/Ui1M4trX5oAsJnhSlk=
99103
github.com/klauspost/compress v1.19.1/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ=
104+
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
105+
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
106+
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
107+
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
100108
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
101109
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
102110
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de h1:9TO3cAIGXtEhnIaL+V+BEER86oLrvS+kWobKpbJuye0=
103111
github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de/go.mod h1:zAbeS9B/r2mtpb6U+EI2rYA5OAXxsYw6wTamcNW+zcE=
112+
github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
113+
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
114+
github.com/moby/spdystream v0.5.1 h1:9sNYeYZUcci9R6/w7KDaFWEWeV4LStVG78Mpyq/Zm/Y=
115+
github.com/moby/spdystream v0.5.1/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
104116
github.com/moby/term v0.5.2 h1:6qk3FJAFDs6i/q3W/pQ97SX192qKfZgGjCQqfCJkgzQ=
105117
github.com/moby/term v0.5.2/go.mod h1:d3djjFCrjnB+fl8NJux+EJzu0msscUP+f8it8hPkFLc=
106118
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -113,6 +125,8 @@ github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 h1:n6/
113125
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00/go.mod h1:Pm3mSP3c5uWn86xMLZ5Sa7JB9GsEZySvHYXCTK4E9q4=
114126
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
115127
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
128+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
129+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
116130
github.com/onsi/ginkgo/v2 v2.27.2 h1:LzwLj0b89qtIy6SSASkzlNvX6WktqurSHwkk2ipF/Ns=
117131
github.com/onsi/ginkgo/v2 v2.27.2/go.mod h1:ArE1D/XhNXBXCBkKOLkbsb2c81dQHCRcF5zwn/ykDRo=
118132
github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A=
@@ -130,6 +144,8 @@ github.com/prometheus/common v0.71.0 h1:9KDAKb7Mj3HEVKyFCK6Dc/HIwlBzZIN2l7/lrHl3
130144
github.com/prometheus/common v0.71.0/go.mod h1:CLJ5H8TEsGX8bl31BdMkfhIZ+QmZ9tBPPotUxUbfcmk=
131145
github.com/prometheus/procfs v0.22.0 h1:6q9+/JL9IKAPbCmBrv9n5O5Ty3NKnciV5X7YGw0oics=
132146
github.com/prometheus/procfs v0.22.0/go.mod h1:CvmFr/GVhIjIvWJZW3tgkODBQMRIf0EyWMQLHCHab58=
147+
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=
148+
github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc=
133149
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
134150
github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw=
135151
github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
@@ -218,11 +234,15 @@ google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsok
218234
google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc=
219235
google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
220236
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
237+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
238+
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
221239
gopkg.in/evanphx/json-patch.v4 v4.13.0 h1:czT3CmqEaQ1aanPc5SdlgQrrEIb8w/wwCvWWnfEbYzo=
222240
gopkg.in/evanphx/json-patch.v4 v4.13.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
223241
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
224242
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
225243
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
244+
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
245+
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
226246
k8s.io/api v0.35.3 h1:pA2fiBc6+N9PDf7SAiluKGEBuScsTzd2uYBkA5RzNWQ=
227247
k8s.io/api v0.35.3/go.mod h1:9Y9tkBcFwKNq2sxwZTQh1Njh9qHl81D0As56tu42GA4=
228248
k8s.io/apiextensions-apiserver v0.35.3 h1:2fQUhEO7P17sijylbdwt0nBdXP0TvHrHj0KeqHD8FiU=

‎hack/quickstart/deploy-otel.sh‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
# With --postgres, deploys a Postgres instance and routes agentic logs
88
# to it for the console audit UI.
99
#
10-
# The Service uses service-ca for TLS. The generated cert secret
11-
# (lightspeed-otel-collector-cert) is referenced in the agentic
12-
# configuration ConfigMap as otel-ca-secret.
10+
# The Service uses service-ca for TLS. Its generated serving-cert secret
11+
# (lightspeed-otel-collector-cert) is mounted by the collector only. Clients
12+
# must instead trust the service CA via lightspeed-agentic-otel-ca (key:
13+
# otel-ca.crt), which deploy-configmap.sh references as otel-ca-secret.
1314
#
1415
# Usage:
1516
# bash hack/quickstart/deploy-otel.sh

‎scripts/e2e-cluster.sh‎

Lines changed: 46 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
# E2E_MODEL — override default model for the provider
2323
# ARTIFACT_DIR — directory for test artifacts
2424
# KONFLUX_COMPONENT_NAME — component name for SNAPSHOT parsing
25+
# E2E_OTEL_ENABLED — deploy persistent OTEL/Postgres collector for
26+
# sandbox-log artifacts (default: true)
27+
# E2E_OTEL_IMAGE — override the OTEL collector image
2528

2629
set -euo pipefail
2730

@@ -34,6 +37,19 @@ source "$SCRIPT_DIR/e2e-lib.sh"
3437
PROVIDERS="${*:-claude gemini openai}"
3538
NAMESPACE="${OPERATOR_NAMESPACE:-openshift-lightspeed}"
3639
export OPERATOR_NAMESPACE="$NAMESPACE"
40+
SCENARIOS_TMPDIR=""
41+
42+
# shellcheck disable=SC2329 # Invoked indirectly by the EXIT trap.
43+
_cleanup_on_exit() {
44+
log_info "Running cleanup..."
45+
cleanup_e2e_otel "$NAMESPACE"
46+
cleanup_operator
47+
if [[ -n "${SCENARIOS_TMPDIR:-}" && -d "$SCENARIOS_TMPDIR" ]]; then
48+
log_info "Removing scenarios clone: $SCENARIOS_TMPDIR"
49+
rm -rf "$SCENARIOS_TMPDIR"
50+
fi
51+
}
52+
trap _cleanup_on_exit EXIT
3753

3854
log_info "=== e2e-cluster.sh ==="
3955
log_info "Providers: $PROVIDERS"
@@ -45,6 +61,13 @@ parse_snapshot
4561
cd "$REPO_ROOT"
4662

4763
deploy_operator
64+
ensure_e2e_otel "$NAMESPACE"
65+
66+
# Clone troubleshooting scenarios from rhobs for product_e2e tests.
67+
SCENARIOS_TMPDIR="$(mktemp -d)"
68+
log_info "Cloning rhobs/troubleshooting-scenarios → $SCENARIOS_TMPDIR"
69+
git clone --depth 1 https://github.com/rhobs/troubleshooting-scenarios.git "$SCENARIOS_TMPDIR"
70+
export E2E_SCENARIOS_DIR="$SCENARIOS_TMPDIR"
4871

4972
declare -A results
5073
overall_rc=0
@@ -70,40 +93,38 @@ run_provider() {
7093

7194
log_info "--- Running e2e for provider=$provider model=$model ---"
7295

96+
local e2e_env=(
97+
E2E_PROVIDER="$provider"
98+
E2E_MODEL="$model"
99+
E2E_PROVIDER_KEY_PATH="$key_path"
100+
E2E_POLL_TIMEOUT="${E2E_POLL_TIMEOUT:-20m}"
101+
VERTEX_PROJECT_ID="${VERTEX_PROJECT_ID:-}"
102+
VERTEX_REGION="${VERTEX_REGION:-global}"
103+
TEST_NAMESPACE="$NAMESPACE"
104+
)
105+
73106
local test_rc=0
74107

75-
if [[ -n "${ARTIFACT_DIR:-}" ]]; then
76-
mkdir -p "$ARTIFACT_DIR/$provider"
77-
E2E_PROVIDER="$provider" \
78-
E2E_MODEL="$model" \
79-
E2E_PROVIDER_KEY_PATH="$key_path" \
80-
E2E_POLL_TIMEOUT="${E2E_POLL_TIMEOUT:-20m}" \
81-
VERTEX_PROJECT_ID="${VERTEX_PROJECT_ID:-}" \
82-
VERTEX_REGION="${VERTEX_REGION:-global}" \
83-
TEST_NAMESPACE="$NAMESPACE" \
84-
make test-e2e 2>&1 | tee "$ARTIFACT_DIR/$provider/test-output.log" || test_rc=$?
85-
else
86-
E2E_PROVIDER="$provider" \
87-
E2E_MODEL="$model" \
88-
E2E_PROVIDER_KEY_PATH="$key_path" \
89-
E2E_POLL_TIMEOUT="${E2E_POLL_TIMEOUT:-20m}" \
90-
VERTEX_PROJECT_ID="${VERTEX_PROJECT_ID:-}" \
91-
VERTEX_REGION="${VERTEX_REGION:-global}" \
92-
TEST_NAMESPACE="$NAMESPACE" \
93-
make test-e2e || test_rc=$?
108+
# Product e2e (troubleshooting scenarios against real LLMs).
109+
# Mock-only tests (failure_test.go etc.) run in precommit CI via `make test-e2e`.
110+
if [[ -n "${E2E_SCENARIOS_DIR:-}" ]]; then
111+
log_info "--- Running product e2e for provider=$provider ---"
112+
if [[ -n "${ARTIFACT_DIR:-}" ]]; then
113+
mkdir -p "$ARTIFACT_DIR/$provider"
114+
env "${e2e_env[@]}" E2E_SCENARIOS_DIR="$E2E_SCENARIOS_DIR" \
115+
go test -tags=product_e2e ./test/e2e/... -count=1 -v -timeout 120m \
116+
2>&1 | tee "$ARTIFACT_DIR/$provider/product-e2e-output.log" || test_rc=$?
117+
else
118+
env "${e2e_env[@]}" E2E_SCENARIOS_DIR="$E2E_SCENARIOS_DIR" \
119+
go test -tags=product_e2e ./test/e2e/... -count=1 -v -timeout 120m || test_rc=$?
120+
fi
94121
fi
95122

96123
collect_artifacts "$provider"
97124

98125
return "$test_rc"
99126
}
100127

101-
_cleanup_on_exit() {
102-
log_info "Running cleanup..."
103-
cleanup_operator
104-
}
105-
trap _cleanup_on_exit EXIT
106-
107128
for provider in $PROVIDERS; do
108129
set +e
109130
run_provider "$provider"

0 commit comments

Comments
 (0)