> For the complete documentation index, see [llms.txt](https://motivlabs.gitbook.io/diesel/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://motivlabs.gitbook.io/diesel/run-unit-tests.md).

# Run Unit Tests

To run the unit tests you have to build the docker image and then run it.

```
docker build --build-arg GITHUB_USER=${USER} --build-arg GITHUB_TOKEN=${TOKEN} -f docker-tools/Dockerfile --target unit-test -t motivlabs/diesel-unit .
```

```
docker run motivlabs/diesel-unit:latest
```

Unit tests in Go require a test to exist in every package to get coverage reporting. If you are building code ensure to always add UNIT tests to new packages

## Run integration Tests

Running Integration tests is pretty easy with the supplied docker-compose file

Running Integration tests is pretty easy with the supplied docker-compose file

```
GITHUB_USER=${USER} GITHUB_TOKEN=${TOKEN} docker-compose -f docker-tools/docker-compose.yml -f docker-tools/docker-compose-itest.yml up --build
```

The above command will build the images and setup all requires ports

Make sure to run the following when finished to ensure the network stops

```
docker-compose -f docker-tools/docker-compose.yml -f docker-tools/docker-compose-itest.yml down
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://motivlabs.gitbook.io/diesel/run-unit-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.
