Run TypeScript client tests from ogx (replay mode) #112
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Integration Tests (Client-side) | |
| run-name: Run TypeScript client tests from ogx (replay mode) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - generated | |
| - 'release-[0-9]+.[0-9]+.x' | |
| pull_request: | |
| branches: | |
| - main | |
| - generated | |
| - 'release-[0-9]+.[0-9]+.x' | |
| types: [opened, synchronize, reopened] | |
| paths: | |
| - 'src/**' | |
| - 'tests/integration/**' | |
| - 'package.json' | |
| - 'yarn.lock' | |
| - '.github/workflows/integration-tests.yml' | |
| workflow_dispatch: | |
| concurrency: | |
| # Skip concurrency for pushes to main - each commit should be tested independently | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| run-replay-mode-tests: | |
| runs-on: ubuntu-latest | |
| name: ${{ format('Integration Tests ({0}, {1})', matrix.suite, matrix.setup) }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # TypeScript client test configurations | |
| # Must match entries in ogx/tests/integration/client-typescript/suites.json | |
| include: | |
| - suite: responses | |
| setup: gpt | |
| - suite: base | |
| setup: ollama | |
| steps: | |
| - name: Checkout ogx-client-typescript repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: ogx-client-typescript | |
| - name: Checkout ogx repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: ogx-ai/ogx | |
| ref: main | |
| path: ogx | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| python-version: '3.12' | |
| version: '0.7.6' | |
| - name: Build TypeScript client | |
| working-directory: ogx-client-typescript | |
| run: | | |
| echo "Building TypeScript client..." | |
| yarn install --frozen-lockfile | |
| yarn build | |
| echo "✅ TypeScript client built successfully" | |
| - name: Install ogx dependencies | |
| working-directory: ogx | |
| run: | | |
| echo "Installing ogx dependencies" | |
| uv sync --all-groups | |
| uv pip install faiss-cpu | |
| - name: Build Ogx | |
| working-directory: ogx | |
| run: | | |
| echo "Building Ogx" | |
| OGX_DIR=. \ | |
| uv run --no-sync ogx stack list-deps ci-tests | xargs -L1 uv pip install | |
| - name: Configure git for commits | |
| working-directory: ogx | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| - name: Check Storage and Memory Available Before Tests | |
| if: always() | |
| run: | | |
| free -h | |
| df -h | |
| - name: Run Integration Tests (TypeScript only) | |
| working-directory: ogx | |
| env: | |
| OPENAI_API_KEY: dummy | |
| TS_CLIENT_PATH: ${{ github.workspace }}/ogx-client-typescript | |
| run: | | |
| STACK_CONFIG="server:ci-tests" | |
| SCRIPT_ARGS="--stack-config $STACK_CONFIG --inference-mode replay --typescript-only" | |
| # Add suite and setup arguments | |
| SCRIPT_ARGS="$SCRIPT_ARGS --setup ${{ matrix.setup }}" | |
| SCRIPT_ARGS="$SCRIPT_ARGS --suite ${{ matrix.suite }}" | |
| echo "=== Running TypeScript client tests only ===" | |
| echo "Client path: $TS_CLIENT_PATH" | |
| echo "Command: uv run --no-sync ./scripts/integration-tests.sh $SCRIPT_ARGS" | |
| echo "" | |
| uv run --no-sync ./scripts/integration-tests.sh $SCRIPT_ARGS | tee typescript-tests.log | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: logs-${{ github.run_id }}-${{ github.run_attempt || '1' }}-${{ strategy.job-index || github.job }}-${{ github.action }} | |
| path: | | |
| ogx/*.log | |
| retention-days: 1 |