---
# System prepended metadata

title: Tests in ArmoniK Core
tags: [A]

---


# Tests in ArmoniK Core

Tests in ArmoniK Core are composed of unit and integration tests that verify the proper functioning of ArmoniK Core and the success of a deployment.

These are the unit tests that should run independently of ArmoniK Core deployment: 

- ArmoniK.Core.Common.Tests
- ArmoniK.Core.Adapters.Memory.Tests
- ArmoniK.Core.Adapters.MongoDB.Tests
- ArmoniK.Core.Adapters.Redis.Tests (Only Windows)

These tests require a partial deployment in order to work properly:

- ArmoniK.Core.Adapters.Amqp.Tests
- ArmoniK.Core.Adapters.RabbitMQ.Tests
- ArmoniK.Core.Adapters.S3.Tests
- ArmoniK.Core.Adapters.LocalStorage.Tests

By partial deployment we mean that it its not necessary to deploy the
full infrastructure, for example for the Amqp tests, a container running
either activemqp or rabbimq broker is necessary.

These are the tests that need a Core deployment prior to running:
- Integration Tests: Stream, HtcMock and Bench tests

You can execute the tests using a code editor, or via the command line.  It is recommended to have an Integrated Development Environment such as Microsoft Visual Studio or JetBrains. 
To know how to execute tests, see: [How to execute tests in ArmoniK Core?](https://hackmd.io/NEUghhgaTUOYcMhxfnEiKw).

## Before running tests
These are the unit tests that should run independently of ArmoniK Core deployment: 

- ArmoniK.Core.Common.Tests
- ArmoniK.Core.Adapters.Memory.Tests
- ArmoniK.Core.Adapters.MongoDB.Tests
- ArmoniK.Core.Adapters.Redis.Tests (Only Windows)

These tests require a partial deployment in order to work properly:

- ArmoniK.Core.Adapters.Amqp.Tests
- ArmoniK.Core.Adapters.RabbitMQ.Tests
- ArmoniK.Core.Adapters.S3.Tests
- ArmoniK.Core.Adapters.LocalStorage.Tests

By partial deployment we mean that it its not necessary to deploy the
full infrastructure, for example for the Amqp tests, a container running
either activemqp or rabbimq broker is necessary. For the case of the latter, you could execute:

```
just queue=rabbitmq deployTargetQueue
```

These are the tests that need a Core deployment prior to running:
- Integration Tests: Stream, HtcMock and Bench tests

To be able to run these tests, you need first to deploy ArmoniK Core with the appropriate parameters: queue, object, and worker.
This is the default recipe for deployment:
```
just deploy
```
It uses activemq for the queue, so if you deploy using this default recipe, ArmoniK.Core.Adapters.Amqp.Tests tests should pass.

To deploy differently, use the full recipe and specify the parameters. For example, to be able to run ArmoniK.Core.Adapters.S3.Tests, deploy first using:
```
just object=minio deployTargetObject
```
For ArmoniK.Core.Adapters.RabbitMQ.Tests deploy with rabbitmq as queue:
```
just queue=rabbitmq deployTargetQueue
```
For ArmoniK.Core.Adapters.LocalStorage.Tests with local object storage:
```
just object=local deployTargetObject
```
For ArmoniK.Extensions.Common.StreamWrapper.Tests.Client tests deploy with stream worker:
```
just worker=stream deploy
```
For HtcMock and Bench, there are specific recipes that build the corresponding docker image for each. First use this recipe. Then deploy using the corresponding value for the parameter worker:
```
just worker=htcmock deploy
```
for htcmock, or you can use the default recipe that uses htcmock worker.
And 
```
just worker=bench deploy
```
And finally, run the test. 
:::warning
:warning: PS: 
1. je trouve cette note a besoin d'un peu de ménage mais je ne sais pas quoi enlever mais de manière à rester clair.
2. je ne trouve pas quel titre donner à cette section/article, ce que j'ai mis dedans c'est ce qu'il faut faire avant d'exécuter les tests et je ferai une deuxième partie sur comment exécuter les tests.
3. Les noms des tests je les ai copiés de Visual Studio par ex ArmoniK.Core.Adapters.LocalStorage.Tests. est ce  que je les laisse comme ça ou il y a un autre moyen de désigner ces tests?
> c'est très bien comme ça, c'est le nom des projets c# donc on comprend bien ce à quoi on réfère
:::
## How to run the tests?
Using Visual Studio or command line TO BE COMPLETED and put in different article 