Skip to content

fix: report actual synced connection count in connector_sync (#1547) #2620

fix: report actual synced connection count in connector_sync (#1547)

fix: report actual synced connection count in connector_sync (#1547) #2620

name: Integration Tests
on:
pull_request:
paths:
- 'src/**.py'
- 'tests/**.py'
- 'pyproject.toml'
- 'uv.lock'
- 'sdks/**'
- 'flows/**'
- 'Makefile'
- 'scripts/**'
- '.github/workflows/test-integration.yml'
workflow_dispatch:
inputs:
use_local_images:
description: 'Build images locally instead of pulling from DockerHub'
required: false
type: boolean
default: true
env:
# Prefer repository/environment variable first, then secret, then a sane fallback
OPENSEARCH_PASSWORD: ${{ vars.OPENSEARCH_PASSWORD || secrets.OPENSEARCH_PASSWORD || 'OpenRag#2025!' }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
LANGFLOW_AUTO_LOGIN: "True"
LANGFLOW_NEW_USER_IS_ACTIVE: "True"
LANGFLOW_ENABLE_SUPERUSER_CLI: "True"
LANGFLOW_CHAT_FLOW_ID: ${{ vars.LANGFLOW_CHAT_FLOW_ID || '1098eea1-6649-4e1d-aed1-b77249fb8dd0' }}
LANGFLOW_INGEST_FLOW_ID: ${{ vars.LANGFLOW_INGEST_FLOW_ID || '5488df7c-b93f-4f87-a446-b67028bc0813' }}
NUDGES_FLOW_ID: ${{ vars.NUDGES_FLOW_ID || 'ebc01d31-1976-46ce-a385-b0240327226c' }}
CI_IMAGE_TAG: ci-${{ github.sha }}
jobs:
build-images:
runs-on:
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
steps:
- run: df -h
- name: Cleanup Docker cache
run: |
docker system prune -af || true
docker builder prune -af || true
docker compose -f docker-compose.yml down -v --remove-orphans || true
- name: Cleanup root-owned files (OpenSearch data, config, Langflow data, keys, data, flows, documents)
run: |
for i in 1 2 3; do
docker run --rm -v $(pwd):/work alpine sh -c "rm -rf /work/opensearch-data /work/config /work/langflow-data /work/keys /work/data /work/flows /work/openrag-documents" && break
echo "Attempt $i failed, retrying in 5s..."
sleep 5
done || true
- run: df -h
- name: Checkout
uses: actions/checkout@v4
- name: Verify workspace
run: |
echo "Current directory: $(pwd)"
echo "Workspace: ${GITHUB_WORKSPACE}"
ls -la
- name: Build OpenRAG images
run: |
USE_LOCAL="${{ inputs.use_local_images }}"
if [ "${{ github.event_name }}" == "pull_request" ] || [ "$USE_LOCAL" != "false" ]; then
echo "Building PR images locally..."
OPENRAG_VERSION="${CI_IMAGE_TAG}" make ci-build-images
else
echo "Preparing DockerHub images..."
docker pull langflowai/openrag-backend:latest
docker pull langflowai/openrag-frontend:latest
docker pull langflowai/openrag-langflow:latest
docker tag langflowai/openrag-backend:latest "langflowai/openrag-backend:${CI_IMAGE_TAG}"
docker tag langflowai/openrag-frontend:latest "langflowai/openrag-frontend:${CI_IMAGE_TAG}"
docker tag langflowai/openrag-langflow:latest "langflowai/openrag-langflow:${CI_IMAGE_TAG}"
docker build --no-cache -t "langflowai/openrag-opensearch:${CI_IMAGE_TAG}" -f Dockerfile .
fi
- name: Save OpenRAG images
run: OPENRAG_VERSION="${CI_IMAGE_TAG}" make ci-save-images
- name: Upload OpenRAG image artifact
uses: actions/upload-artifact@v4
with:
name: openrag-ci-images-${{ github.sha }}
path: .ci-artifacts/openrag-ci-images.tar
retention-days: 1
compression-level: 0
test-suite:
needs: build-images
runs-on:
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
strategy:
fail-fast: false
matrix:
suite: [core, sdk-python, sdk-typescript]
name: tests (${{ matrix.suite }})
steps:
- run: df -h
- name: Cleanup Docker cache
run: |
docker system prune -af || true
docker builder prune -af || true
docker compose -f docker-compose.yml down -v --remove-orphans || true
- name: Cleanup root-owned files (OpenSearch data, config, Langflow data, keys, data, flows, documents)
run: |
for i in 1 2 3; do
docker run --rm -v $(pwd):/work alpine sh -c "rm -rf /work/opensearch-data /work/config /work/langflow-data /work/keys /work/data /work/flows /work/openrag-documents" && break
echo "Attempt $i failed, retrying in 5s..."
sleep 5
done || true
- run: df -h
- name: Checkout
uses: actions/checkout@v4
- name: Verify workspace
run: |
echo "Current directory: $(pwd)"
echo "Workspace: ${GITHUB_WORKSPACE}"
ls -la
- name: Set up UV
uses: astral-sh/setup-uv@v3
with:
version: latest
- name: Set up Node.js
if: matrix.suite == 'sdk-typescript'
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Python version
run: uv python install 3.13
- name: Download OpenRAG image artifact
uses: actions/download-artifact@v4
with:
name: openrag-ci-images-${{ github.sha }}
path: .ci-artifacts
- name: Load OpenRAG images
run: docker load -i .ci-artifacts/openrag-ci-images.tar
- name: Run ${{ matrix.suite }} integration suite
env:
OPENSEARCH_HOST: localhost
OPENSEARCH_PORT: 9200
OPENSEARCH_USERNAME: admin
OPENSEARCH_PASSWORD: ${{ env.OPENSEARCH_PASSWORD }}
LOG_LEVEL: DEBUG
# Force no-auth mode so tests bypass OAuth
GOOGLE_OAUTH_CLIENT_ID: ""
GOOGLE_OAUTH_CLIENT_SECRET: ""
# Disable startup ingest noise unless a test enables it
DISABLE_STARTUP_INGEST: "true"
run: |
OPENRAG_VERSION="${CI_IMAGE_TAG}" TEST_SUITE="${{ matrix.suite }}" make test-ci-suite
echo "Keys directory after tests:"
ls -la keys/ || echo "No keys directory"
tests:
needs: [build-images, test-suite]
if: always()
runs-on:
labels: ["self-hosted", "linux", "ARM64", "langflow-ai-arm64-40gb-ephemeral-sudo"]
steps:
- name: Check split integration result
run: |
if [ "${{ needs.build-images.result }}" != "success" ]; then
echo "build-images failed"
exit 1
fi
if [ "${{ needs.test-suite.result }}" != "success" ]; then
echo "one or more integration suites failed"
exit 1
fi
echo "all integration suites passed"