Skip to content

feat(otel): normalize host-style provider aliases to canonical names #6898

feat(otel): normalize host-style provider aliases to canonical names

feat(otel): normalize host-style provider aliases to canonical names #6898

name: TypeScript SDK E2E Tests
run-name: "TypeScript SDK E2E Tests ${{ github.ref_name }} by @${{ github.actor }}"
permissions:
contents: read
packages: read
on:
workflow_dispatch:
pull_request:
paths:
- 'sdks/typescript/**'
- 'apps/opik-backend/**'
- '.github/workflows/typescript_sdk_e2e_tests.yml'
push:
branches:
- 'main'
paths:
- 'sdks/typescript/**'
- 'apps/opik-backend/**'
- '.github/workflows/typescript_sdk_e2e_tests.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
OPIK_ENABLE_LITELLM_MODELS_MONITORING: False
OPIK_SENTRY_ENABLE: False
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_ORG_ID: ${{ secrets.OPENAI_ORG_ID }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
OPIK_URL_OVERRIDE: http://localhost:8080
OPIK_CONSOLE_LOGGING_LEVEL: DEBUG
jobs:
select-matrix:
name: Select Node version matrix
permissions:
contents: read
pull-requests: read
runs-on: ubuntu-latest
timeout-minutes: 2
outputs:
node_versions: ${{ steps.pick.outputs.versions }}
steps:
- uses: actions/checkout@v7
with:
sparse-checkout: .github/actions/select-e2e-matrix
sparse-checkout-cone-mode: false
- uses: ./.github/actions/select-e2e-matrix
id: pick
with:
all-versions: ${{ vars.NODE_VERSIONS }}
match-regex: '^sdks/typescript/|^\.github/workflows/typescript_sdk_e2e_tests\.yml$'
github-token: ${{ secrets.GITHUB_TOKEN }}
build-opik:
# The reusable build workflow pushes images to GHCR; pass down the
# packages: write grant here rather than at the workflow level (a called
# workflow's permissions can only be maintained or reduced from the
# caller's, never elevated).
permissions:
contents: read
packages: write
uses: ./.github/workflows/build_e2e_docker.yaml
run-e2e:
needs: [select-matrix, build-opik]
name: TypeScript SDK E2E Tests Node ${{matrix.node_version}}
permissions:
contents: read
checks: write
pull-requests: write
packages: read
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
node_version: ${{ fromJSON(needs.select-matrix.outputs.node_versions) }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull Docker images from GHCR
env:
TAG: ${{ needs.build-opik.outputs.image_tag }}
run: |
docker pull "ghcr.io/comet-ml/opik/opik-backend:$TAG"
docker pull "ghcr.io/comet-ml/opik/opik-python-backend:$TAG"
docker tag "ghcr.io/comet-ml/opik/opik-backend:$TAG" ghcr.io/comet-ml/opik/opik-backend:latest
docker tag "ghcr.io/comet-ml/opik/opik-python-backend:$TAG" ghcr.io/comet-ml/opik/opik-python-backend:latest
- name: Set up Node.js ${{matrix.node_version}}
uses: actions/setup-node@v7
with:
node-version: ${{matrix.node_version}}
- name: Run latest Opik server
env:
OPIK_USAGE_REPORT_ENABLED: false
COMPOSE_BAKE: false
TOGGLE_RUNNERS_ENABLED: "true"
OPIK_BACKEND_PULL_POLICY: never
PYTHON_BACKEND_PULL_POLICY: never
run: |
cd ${{ github.workspace }}
./opik.sh --backend --port-mapping
- name: Check Opik server availability
shell: bash
run: |
chmod +x ${{ github.workspace }}/tests_end_to_end/installer_utils/*.sh
cd ${{ github.workspace }}/deployment/docker-compose
echo "Check Docker pods are up"
${{ github.workspace }}/tests_end_to_end/installer_utils/check_docker_compose_pods.sh
echo "Check backend health"
${{ github.workspace }}/tests_end_to_end/installer_utils/check_backend.sh
- name: Install TypeScript SDK dependencies
working-directory: sdks/typescript
run: npm ci
- name: Build TypeScript SDK
working-directory: sdks/typescript
run: npm run build
- name: Run integration tests
working-directory: sdks/typescript
run: |
# once OPIK-3910 is fixed we can revert to npm run test:integration
npm run test:integration -- --reporter=default --reporter=junit --outputFile.junit=${{ github.workspace }}/test_results_node${{matrix.node_version}}.xml
- name: Publish Test Report
uses: EnricoMi/publish-unit-test-result-action/linux@v2
if: always()
with:
action_fail: true
comment_mode: failures
check_name: "TS SDK E2E Tests - Node ${{matrix.node_version}}"
files: ${{ github.workspace }}/test_results_node${{matrix.node_version}}.xml
- name: Keep BE log in case of failure
if: failure()
run: |
PROJECT_NAME=$(docker compose ls --format json 2>/dev/null | jq -r '.[].Name' | grep '^opik' | head -1)
CONTAINER="${PROJECT_NAME:-opik}-backend-1"
docker logs "$CONTAINER" > ${{ github.workspace }}/opik-backend_node${{matrix.node_version}}.log 2>&1 || echo "Could not capture logs from $CONTAINER"
- name: Attach BE log
if: failure()
uses: actions/upload-artifact@v7
with:
name: opik-backend-log-node${{matrix.node_version}}
path: ${{ github.workspace }}/opik-backend_node${{matrix.node_version}}.log
- name: Stop opik server
if: always()
run: |
cd ${{ github.workspace }}
./opik.sh --stop