You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example-apps/chatbot-rag-app/test/tracetest/README.md
+21-23Lines changed: 21 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ We plan to add tests for additional model configurations in the future.*
5
5
6
6
## Introduction to Trace Testing
7
7
8
-
Trace testing is a modern approach to testing distributed systems by leveraging the distributed traces that flow through your applications. In a complex system like the Chatbot RAG application, traditional testing approaches may fall short because they can't effectively monitor the interactions between microservices, databases, and external APIs.
8
+
Trace testing is a modern approach to testing distributed systems by leveraging the distributed traces that flow through your applications.
9
9
10
-
Tracetest is an open-source tool that enables you to create, run, and maintain integration tests using distributed traces with support for OpenTelemetry and observability backends such as Elastic APM. It allows you to:
10
+
Tracetest is an open-source tool that enables you to create, run, and maintain tests using distributed traces with support for OpenTelemetry and observability backends such as Elastic APM. It allows you to:
11
11
12
12
- Validate the flow of requests through your entire system
13
13
- Assert on specific spans within a trace
@@ -17,27 +17,18 @@ For more information about Tracetest, visit the [official documentation](https:/
17
17
18
18
## Setup
19
19
20
-
Chatbot RAG application setup uses Docker to create a testing environment that includes:
20
+
Our setup uses Docker to create a testing environment that includes:
21
21
22
22
1. A Tracetest server for executing and managing tests
23
-
2. An Elasticsearch cluster for storing traces, logs, and application data
24
-
3. An OpenTelemetry collector for processing and routing telemetry data
25
-
4. The chatbot RAG application itself
26
-
27
-
The setup leverages several Docker Compose files to combine the test environment with the local Elastic Stack (from [docker/docker-compose-elastic.yml](../../../../docker/docker-compose-elastic.yml)) and Chatbot RAG application (from [example-apps/chatbot-rag-app/docker-compose.yml](../../docker-compose.yml)). In order to spin up the up-to-date versions of all moving parts, we leverage overrides maintained within this directory. We use:
28
-
29
-
-`docker-compose.test.yml` - for Tracetest configuration
-`elastic-stack.override.yml` - for test-specific configuration for Elasticsearch and OpenTelemetry Collector
32
-
-`chatbot-rag.override.yml` - for configuration of the chatbot application in test mode.
33
-
34
-
All services are connected through a shared Docker network to enable communication between components.
23
+
2. An OpenTelemetry collector for processing and routing telemetry data
24
+
3. Tracetest test running that uses Tracetest CLI to communicate with Tracetest server and execute tests based on the specified configuration.
25
+
4. Optionally, you can also setup the Elastic Stack and the chatbot-rag-app itself if you don't have them running in your environment.
35
26
36
27
## Environment Configuration
37
28
38
-
Before running tests, you need to prepare a `.env.test` file with the necessary environment variables. This file configures the behavior of the chatbot application during testing (same configuration as described in [the applications's directory](../../README.md)).
29
+
The test environment expects the Elastic Stack and chatbot-rag-app to run locally. If you already have these services running, you're ready to execute the tests and skip to the next section.
39
30
40
-
Create a `.env.test` file in the `test/tracetest` directory with the following content to reproduce the environment we're testing with:
31
+
If you are starting without from scratch, you will need to set up the necessary environment variables for the chatbot-rag-app. For this you can follow setup the instructions in [the applications's directory](../../README.md#make-your-env-file) or copy our example to `.env` file in `example-apps/chatbot-rag-app`:
41
32
42
33
```bash
43
34
# Location of the application routes
@@ -46,7 +37,7 @@ FLASK_APP=api/app.py
46
37
PYTHONUNBUFFERED=1
47
38
48
39
# How you connect to Elasticsearch: change details to your instance
0 commit comments