Skip to content

test: add agentic chat load test of GraphQL endpoint and websockets

What does this merge request do and why?

  • Adds a load test that can test either real LLM responses, or mocked responses. Set SCENARIO_TYPE=real_llm for real resposnes, otherwise mocked responses are the default
  • Also renames the existing workflow tests to highlight that they test the REST API endpoint, not GraphQL

The existing test, api_v4_duo_workflow_chat.js, only tests initiating a workflow. It doesn't wait for LLM responses.

This new test uses graphQL and websockets to start a workflow and wait for responses (like the frontend does).

Related:

How to set up and validate locally

  1. Set up GDK for testing DAP, but enable mock responses by setting in gitlab-ai-gateway/.env:

    AIGW_MOCK_MODEL_RESPONSES=true
    AIGW_USE_AGENTIC_MOCK=true
  2. Export environment variables required to run a load test against GDK

    export ENVIRONMENT_URL=http://gdk.test:3000
    export ACCESS_TOKEN=<gitlab personal access token with api scope>
    export AI_DUO_WORKFLOW_PROJECT_ID=1000000 
    export AI_DUO_WORKFLOW_ROOT_NAMESPACE_ID=1000000
  3. Run a load test

    k6 run performance_tests/stress_tests/api_v4_duo_workflow_chat_graphql_api.js

Merge request checklist

  • Tests added for new functionality. If not, please raise an issue to follow up.
  • Documentation added/updated, if needed.
  • If this change requires executor implementation: verified that issues/MRs exist for both Go executor and Node executor or confirmed that changes are backward-compatible and don't break existing executor functionality.
Edited by Mark Lapierre

Merge request reports

Loading