---
# System prepended metadata

title: How to execute tests in ArmoniK Core?
tags: [A]

---

# How to execute tests in ArmoniK Core?

## Unit tests independent of deployment
For this type of tests, you can directly execute it. The first option is to run the tests using your code editor. The second is to open a terminal, go to the folder where the test project is located and do:
```
dotnet test
```
## Unit tests that need partial deployment 
First, you should do the needed partial deployment that deploys the container running needed service. 
For example, for the case of ArmoniK.Core.Adapters.RabbitMQ.Tests, execute:
```
just queue=rabbitmq deployTargetQueue
```
For ArmoniK.Core.Adapters.LocalStorage.Tests with local object storage:
```
just object=local deployTargetObject
```
And so you can execute the corresponding tests:
- via your code editor
- or in your command line, go to the folder where the test project is located and do:
```
dotnet test
```

## Integration Tests

HtcMock, Stream and Bench are integration tests that need a Core deployment. To be able to run these tests, you need first to deploy ArmoniK Core with the appropriate values for the parameter `worker`: htcmock or stream or bench. If you don't specify any value for this parameter it's set to htcmock by default. Don't forget to use the recipe to build the images for your deployments if they do not exist.

### Htcmock
The default deployment is done with htcmock worker:
```
just deploy
```
After this deployment, there is a `just` recipe that allows to build the docker image to test htcmock worker, you can use it to build the image:
```
just buildHtcmockClient 
```
Finally execute the test using: 
```
docker run --net armonik_network --rm \
            -e HtcMock__NTasks=100 \
            -e HtcMock__TotalCalculationTime=00:00:00.100 \
            -e HtcMock__DataSize=1 \
            -e HtcMock__MemorySize=1 \
      	    -e HtcMock__EnableFastCompute=true \
            -e HtcMock__SubTasksLevels=1 \
            -e HtcMock__Partition=TestPartition0 \
            -e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
             dockerhubaneo/armonik_core_htcmock_test_client:TAG

```
You will need to replace `TAG` by the tag of your image `armonik_core_htcmock_test_client`. If you don't specify any tag for `just buildHtcmockClient`, the tag will be `test`, but you are given the option to use your own tag:
```
just tag=mytag buildHtcmockClient 
```

### Stream
Deploy using stream worker:
```
just worker=stream deploy
```
Use the recipe to build the docker image for stream worker:
```
just buildStreamClient 
```
Now, you can execute the tests using your code editor, or via the command line. In the latter case, go to the folder where the tests are located and type:
```
dotnet test
```

### Bench
Deploy using bench worker:
```
just worker=bench deploy
```
Build the docker image:
```
just buildBenchClient 
```
Execute the tests using:
```
docker run --net armonik_network --rm \
            -e BenchOptions__NTasks=200 \
            -e BenchOptions__TaskDurationMs=100 \
            -e GrpcClient__Endpoint=http://armonik.control.submitter:1080 \
            dockerhubaneo/armonik_core_bench_test_client:TAG
```
Same for the case of Htcmock, consider replacing `TAG` by the tag of your image `armonik_core_bench_test_client` . 