Skip to content

Commit 16de6d2

Browse files
authored
Merge pull request #181 from rh-ai-quickstart/release/v0.2.43
Release v0.2.43
2 parents 6a0b504 + 5382606 commit 16de6d2

8 files changed

Lines changed: 114 additions & 55 deletions

File tree

.github/workflows/e2e-tests.yaml

Lines changed: 65 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
name: E2E Tests
22

3-
on:
4-
pull_request:
5-
branches:
6-
- main
7-
paths:
8-
- 'frontend/**'
9-
- 'deploy/helm/**'
10-
- 'tests/**'
11-
- '.github/workflows/e2e-tests.yaml'
12-
push:
13-
branches:
14-
- main
15-
workflow_dispatch:
3+
on: [pull_request, push, workflow_dispatch]
164

175
# MaaS configuration - can be overridden with repository secrets for different environments
186
env:
@@ -754,3 +742,67 @@ jobs:
754742
run: |
755743
pkill -f "kubectl port-forward" || true
756744
# kind delete cluster --name rag-e2e-ui
745+
746+
# Single check to mark as required in branch protection (Settings → Branches →
747+
# Require status checks): "PR tests gate". Fails if unit/integration failed, or
748+
# if MaaS-backed jobs ran and failed. Fork PRs may skip secret-dependent jobs.
749+
pr-required-checks:
750+
name: PR tests gate
751+
runs-on: ubuntu-latest
752+
if: always() && github.event_name == 'pull_request'
753+
needs:
754+
- unit-tests
755+
- integration-tests
756+
- llamastack-integration-tests
757+
- ui-e2e-tests
758+
steps:
759+
- name: Enforce test job outcomes
760+
env:
761+
UNIT_RESULT: ${{ needs.unit-tests.result }}
762+
INTEG_RESULT: ${{ needs.integration-tests.result }}
763+
LLAMA_RESULT: ${{ needs.llamastack-integration-tests.result }}
764+
UI_RESULT: ${{ needs.ui-e2e-tests.result }}
765+
HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }}
766+
THIS_REPO: ${{ github.repository }}
767+
run: |
768+
set -euo pipefail
769+
is_fork=false
770+
if [ "${HEAD_REPO}" != "${THIS_REPO}" ]; then
771+
is_fork=true
772+
fi
773+
774+
echo "Job results: unit=${UNIT_RESULT} integration=${INTEG_RESULT} llamastack=${LLAMA_RESULT} ui-e2e=${UI_RESULT} fork=${is_fork}"
775+
776+
if [ "${UNIT_RESULT}" != "success" ]; then
777+
echo "::error::Unit tests did not succeed (result=${UNIT_RESULT})"
778+
exit 1
779+
fi
780+
if [ "${INTEG_RESULT}" != "success" ]; then
781+
echo "::error::Integration tests (Streamlit) did not succeed (result=${INTEG_RESULT})"
782+
exit 1
783+
fi
784+
785+
allow_skipped_secret_jobs() {
786+
local r="$1"
787+
[ "${is_fork}" = true ] && [ "${r}" = "skipped" ]
788+
}
789+
790+
if [ "${LLAMA_RESULT}" != "success" ]; then
791+
if allow_skipped_secret_jobs "${LLAMA_RESULT}"; then
792+
echo "LlamaStack integration tests were skipped (fork PR; repository secrets are not available)."
793+
else
794+
echo "::error::LlamaStack integration tests did not succeed (result=${LLAMA_RESULT})"
795+
exit 1
796+
fi
797+
fi
798+
799+
if [ "${UI_RESULT}" != "success" ]; then
800+
if allow_skipped_secret_jobs "${UI_RESULT}"; then
801+
echo "UI E2E tests were skipped (fork PR; repository secrets are not available)."
802+
else
803+
echo "::error::UI E2E tests did not succeed (result=${UI_RESULT})"
804+
exit 1
805+
fi
806+
fi
807+
808+
echo "All required test outcomes for this pull request passed."

deploy/helm/rag/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ apiVersion: v2
22
name: rag
33
description: A Helm chart for Kubernetes
44
type: application
5-
version: 0.2.42
6-
appVersion: "0.2.42"
5+
version: 0.2.43
6+
appVersion: "0.2.43"
77

88
dependencies:
99
- name: pgvector

deploy/helm/rag/values.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ replicaCount: 1
33
image:
44
repository: quay.io/rh-ai-quickstart/llamastack-dist-ui
55
pullPolicy: Always
6-
tag: 0.2.42
6+
tag: 0.2.43
77

88
service:
99
type: ClusterIP
@@ -164,19 +164,6 @@ pgvector:
164164
dbname: rag_blueprint
165165
host: pgvector
166166
port: "5432"
167-
168-
# Create a separate vector database for each ingestion pipeline
169-
extraDatabases:
170-
- name: hr_vector_db
171-
vectordb: true
172-
- name: legal_vector_db
173-
vectordb: true
174-
- name: sales_vector_db
175-
vectordb: true
176-
- name: procurement_vector_db
177-
vectordb: true
178-
- name: techsupport_vector_db
179-
vectordb: true
180167

181168
# Upload sample files to the minio bucket
182169
sampleFileUpload:

tests/e2e_ui/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ pytest==8.3.3
22
pytest-playwright==0.5.2
33
playwright==1.48.0
44
requests==2.32.3
5+
python-docx
6+
openpyxl
57

tests/e2e_ui/test_chat_ui.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,12 +183,6 @@ def test_initial_greeting_message(self, page: Page):
183183
"""Test that initial greeting message is displayed"""
184184
greeting = page.get_by_text("How can I help you?", exact=False)
185185
expect(greeting).to_be_visible(timeout=TEST_TIMEOUT)
186-
187-
def test_tool_debug_toggle(self, page: Page):
188-
"""Test that tool debug toggle is visible"""
189-
debug_toggle = page.get_by_text("Show Tool/Debug Info", exact=False)
190-
expect(debug_toggle).to_be_visible(timeout=TEST_TIMEOUT)
191-
192186

193187
class TestMaaSIntegration:
194188
"""UI tests for MaaS (Model-as-a-Service) integration through the UI

tests/integration/llamastack/test_user_workflow.py

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -286,18 +286,41 @@ def test_complete_rag_workflow():
286286
print("🤖 Step 4: Checking for available models...")
287287
skip_inference = SKIP_MODEL_TESTS == "true"
288288
model_available = False
289-
289+
model_ids = []
290+
290291
try:
291-
# Llama-stack uses /v1/openai/v1/* paths for OpenAI-compatible API
292-
openai_base_url = f"{LLAMA_STACK_ENDPOINT}/v1/openai/v1"
293-
client = OpenAI(
294-
api_key="not_needed",
295-
base_url=openai_base_url,
296-
timeout=30.0
297-
)
298-
299-
print(f" DEBUG: Calling {openai_base_url}/models endpoint...")
300-
models = client.models.list()
292+
# OpenAI-compatible base URL: current Llama Stack uses /v1 (see conftest.py).
293+
# Older stacks used /v1/openai/v1 (client-examples-python/README.md).
294+
endpoint = LLAMA_STACK_ENDPOINT.rstrip("/")
295+
explicit_openai = os.getenv("LLAMA_STACK_OPENAI_BASE")
296+
openai_base_candidates = []
297+
if explicit_openai:
298+
openai_base_candidates.append(explicit_openai.rstrip("/"))
299+
openai_base_candidates.append(f"{endpoint}/v1")
300+
openai_base_candidates.append(f"{endpoint}/v1/openai/v1")
301+
302+
client = None
303+
openai_base_url = None
304+
models = None
305+
last_models_error: Exception | None = None
306+
for base in openai_base_candidates:
307+
candidate = OpenAI(
308+
api_key="not_needed",
309+
base_url=base,
310+
timeout=30.0,
311+
)
312+
try:
313+
print(f" DEBUG: Calling {base}/models endpoint...")
314+
models = candidate.models.list()
315+
client = candidate
316+
openai_base_url = base
317+
break
318+
except Exception as e:
319+
last_models_error = e
320+
continue
321+
322+
if client is None or models is None:
323+
raise last_models_error or RuntimeError("Could not list models from any OpenAI base URL")
301324
print(f" DEBUG: Raw response type: {type(models)}")
302325
print(f" DEBUG: Number of models in response: {len(models.data)}")
303326

tests/integration/test_upload_integration.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def mock_uploaded_file():
6464
class TestDocumentUploadIntegration:
6565
"""Integration tests for document upload workflow"""
6666

67-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
67+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
6868
def test_single_file_upload_workflow(self, mock_api, mock_uploaded_file):
6969
"""Test complete workflow for uploading a single file"""
7070
from llama_stack_client import RAGDocument
@@ -113,7 +113,7 @@ def test_single_file_upload_workflow(self, mock_api, mock_uploaded_file):
113113
mock_api.client.vector_dbs.register.assert_called_once()
114114
mock_api.client.tool_runtime.rag_tool.insert.assert_called_once()
115115

116-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
116+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
117117
def test_multiple_files_upload_workflow(self, mock_api):
118118
"""Test uploading multiple files at once"""
119119
from llama_stack_client import RAGDocument
@@ -182,7 +182,7 @@ def test_file_type_validation(self):
182182
class TestVectorDBCreation:
183183
"""Integration tests for vector database creation"""
184184

185-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
185+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
186186
def test_vector_db_registration_params(self, mock_api):
187187
"""Test vector DB registration with correct parameters"""
188188
mock_api.client.providers.list.return_value = [
@@ -204,7 +204,7 @@ def test_vector_db_registration_params(self, mock_api):
204204
assert call_args[1]['embedding_model'] == "all-MiniLM-L6-v2"
205205
assert call_args[1]['provider_id'] == "pgvector"
206206

207-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
207+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
208208
def test_vector_db_with_custom_name(self, mock_api):
209209
"""Test creating vector DB with custom name"""
210210
mock_api.client.providers.list.return_value = [
@@ -227,7 +227,7 @@ def test_vector_db_with_custom_name(self, mock_api):
227227
class TestProviderDetection:
228228
"""Integration tests for provider detection"""
229229

230-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
230+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
231231
def test_vector_io_provider_detection(self, mock_api):
232232
"""Test that vector_io provider is correctly detected"""
233233
mock_api.client.providers.list.return_value = [
@@ -244,7 +244,7 @@ def test_vector_io_provider_detection(self, mock_api):
244244

245245
assert vector_io_provider == "pgvector"
246246

247-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
247+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
248248
def test_no_vector_io_provider(self, mock_api):
249249
"""Test handling when no vector_io provider is available"""
250250
mock_api.client.providers.list.return_value = [
@@ -264,7 +264,7 @@ def test_no_vector_io_provider(self, mock_api):
264264
class TestDocumentInsertion:
265265
"""Integration tests for document insertion into vector DB"""
266266

267-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
267+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
268268
def test_document_insertion_with_chunks(self, mock_api):
269269
"""Test document insertion with chunking"""
270270
from llama_stack_client import RAGDocument
@@ -288,7 +288,7 @@ def test_document_insertion_with_chunks(self, mock_api):
288288
call_args = mock_api.client.tool_runtime.rag_tool.insert.call_args
289289
assert call_args[1]['chunk_size_in_tokens'] == 512
290290

291-
@patch('llama_stack_ui.distribution.ui.page.upload.upload.llama_stack_api')
291+
@patch('llama_stack_ui.distribution.ui.modules.api.llama_stack_api')
292292
def test_empty_document_list(self, mock_api):
293293
"""Test handling of empty document list"""
294294
documents = []

tests/unit/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ pytest-cov==5.0.0
44
llama-stack-client>=0.2.9,<0.2.13
55
llama-stack
66
streamlit>=1.31.0
7-
7+
python-docx
8+
openpyxl

0 commit comments

Comments
 (0)