# 'Insights - Apollo' cross data verification test framework

There are 2 suites:
- for insights web app
- for insights-go mobile app

## Quick Start

1. Install Python3 (3.11+)
2. `python3 -m venv myenv`


#### Install dependencies

`pip install -r requirements.txt`


### Secrets

[api-data.json](api-data.json) can be fetched (./[fetch_secrets.sh](scripts/fetch_secrets.sh)) from AWS but not necessary for local run

## Running tests locally

`source myenv/bin/activate`
 
example:
`pytest app/src/tests/insights/test_globalSoundRecordingSummary.py`

## Running tests with Datadog tracing

To run tests with Datadog APM tracing enabled, use the `run_tests_traced` make target. Each test will be wrapped in a DD span and trace context will be propagated to all outbound HTTP/GraphQL requests, making the full test→service call chain visible in Datadog APM.

```sh
export DD_API_KEY=<your-api-key>

DD_SERVICE=insights-cross-app-data-tests \
DD_ENV=prod \
DD_CIVISIBILITY_AGENTLESS_ENABLED=true \
DD_CIVISIBILITY_GIT_UPLOAD_ENABLED=false \
DD_SITE=datadoghq.com \
make run_tests_traced
```

After the run, traces appear in **Datadog APM → Tests** under `service:insights-cross-app-data-tests`.

Running without tracing (`make run_tests`) is unchanged — no DD env vars required and behaviour is identical to before.

## Adding new test

1. add query to app/queries
2. add test to app/tests