# Running Tests

You can run any tests you've created (or just the default App Similarity Index test) to investigate the behavior of your application.

## Running Your Tests

When you run a Test Session, you are running your tests against a given Experiment Run.&#x20;

### Choose a Baseline Run

If you haven't already, take a look at the documentation on [setting a Baseline Run](/v0.23.x/using-distributional/runs/setting-a-baseline-run.md). All the methods for running a test will allow you to choose a Baseline Run at the time of Test Session creation, but you can also [set a default](/v0.23.x/using-distributional/runs/setting-a-baseline-run.md#setting-a-default-baseline-run).

### Create a Test Session

Tests are run within the context of a Test Session, which is effectively just a collection of tests run against an Experiment Run with a Baseline Run. You can create a Test Session, which will immediately run the tests, via the UI or the SDK:

{% hint style="info" %}
Regardless of how you choose to create your Test Session, you can specify tags to choose a subset of tests to run in that given session. The following options for tags are available:

* `Include Tags`: Only tests with **any** of these tags will be run
* `Exclude Tags`: Only tests with **none** of these tags will be run
* `Required Tags` : Only tests with **every** one of these tags will be run
  {% endhint %}

{% tabs %}
{% tab title="UI" %}
You can choose to run the tests associated with a Project by clicking on the "Run Tests" button on your Project. This button will open up a modal that allows you to specify the Baseline and Experiment Runs, as well as the tags of the tests you would like to include or exclude from the test session.

<figure><img src="/files/XdMZeGUbWZiCOpnDube5" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="SDK" %}
Tests can be run via the SDK function [`create_test_session`](/v0.23.x/reference/python-sdk/dbnl.md#create_test_session). Most likely, you will want to create a Test Session shortly after you've reported and closed a Run. See [Reporting Runs](/v0.23.x/using-distributional/runs/reporting-runs.md) for more information.

```python
import dbnl
import pandas as pd
dbnl.login()

# More likely, you will use the run reference returned by
# report_run_with_results. See the "Reporting Runs" section in the
# docs (linked above) for more information.
run = dbnl.get_run(run_id="run_abc123")

# See the create_test_session reference documentation (linked above)
# for more options, like overriding the baseline or specifying tags
# to choose a subset of test to run
dbnl.create_test_session(
  experiment_run=run,
)
```

{% endtab %}
{% endtabs %}

Continue onto [Reviewing Tests ](/v0.23.x/using-distributional/tests/reviewing-tests.md)for how to look at and interpret the results from your Test Session.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dbnl.com/v0.23.x/using-distributional/tests/running-tests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
