@@ -91,40 +91,45 @@ Unit test has test cases and input data to solve the problem.
91
91
92
92
Run all tests (skips static analysis, and "clean" test cache before running):
93
93
94
+ By default, there are no log outputs from the application or tests to the console.
95
+ "--verbosity \< LEVEL\> " only control verbosity of dotnet proccess
96
+ (building, test running, ...)
97
+
94
98
``` bash
95
- dotnet test --verbosity normal
99
+ dotnet clean && dotnet test --verbosity normal
96
100
```
97
101
98
- Another way to increase verbosity level in console output:
102
+ To enable console detailed output use :
99
103
100
104
``` bash
101
105
dotnet test --logger " console;verbosity=detailed"
102
106
```
103
107
104
108
#### Test run with alternative behaviors
105
109
106
- > [ !IMPORTANT]
107
- > LOG_LEVEL environment variable not yet implemented.
108
- >
109
- > Currently tests only have one behavior.
110
-
111
110
You can change test running behaviour using some environment variables as follows:
112
111
113
112
| Variable | Values | Default |
114
113
| ------ | ------ | ------ |
115
114
| LOG_LEVEL | ` debug ` , ` warning ` , ` error ` , ` info ` | ` info ` |
116
115
| BRUTEFORCE | ` true ` , ` false ` | ` false ` |
117
116
118
- - ~~ ` LOG_LEVEL ` : change verbosity level in outputs.~~
117
+ - ` LOG_LEVEL ` : change verbosity level in outputs.
119
118
- ` BRUTEFORCE ` : enable or disable running large tests.
120
119
(long time, large amount of data, high memory consumition).
121
120
122
121
#### Examples running tests with alternative behaviors
123
122
123
+ Run tests with debug outputs:
124
+
125
+ ``` bash
126
+ LOG_LEVEL=debug dotnet test --logger " console;verbosity=detailed"
127
+ ```
128
+
124
129
Run brute-force tests with debug outputs:
125
130
126
131
``` bash
127
- BRUTEFORCE=true dotnet test --logger " console;verbosity=detailed"
132
+ BRUTEFORCE=true LOG_LEVEL=debug dotnet test --logger " console;verbosity=detailed"
128
133
```
129
134
130
135
### Install and Run using make
@@ -138,16 +143,22 @@ Run tests (libraries are installed as dependency task in make):
138
143
make test
139
144
```
140
145
141
- Run brute-force tests:
146
+ Run tests with debug outputs:
147
+
148
+ ``` bash
149
+ make test -e LOG_LEVEL=debug
150
+ ```
151
+
152
+ Run brute-force tests with debug outputs:
142
153
143
154
``` bash
144
- make test -e BRUTEFORCE=true
155
+ make test -e BRUTEFORCE=true -e LOG_LEVEL=debug
145
156
```
146
157
147
158
Alternative way, use environment variables as prefix:
148
159
149
160
``` bash
150
- BRUTEFORCE=true make test
161
+ BRUTEFORCE=true LOG_LEVEL=debug make test
151
162
```
152
163
153
164
### Install and Running with Docker 🐳
@@ -174,7 +185,11 @@ BRUTEFORCE=true docker-compose --profile testing run --rm algorithm-exercises-cs
174
185
Overriding docker CMD, as parameter of make "-e":
175
186
176
187
``` bash
177
- docker-compose --profile testing run --rm algorithm-exercises-java-test make test -e BRUTEFORCE=true
188
+ docker-compose --profile testing run --rm algorithm-exercises-csharp-test make test -e BRUTEFORCE=true
189
+ ```
190
+
191
+ ``` bash
192
+ docker-compose --profile testing run --rm algorithm-exercises-csharp-test make test -e LOG_LEVEL=DEBUG -e BRUTEFORCE=true
178
193
```
179
194
180
195
### Install and Running with Docker 🐳 using make
@@ -190,7 +205,7 @@ or overriding CMD and passing to make as "-e" argument.
190
205
Passing environment variables using docker-compose (compose.yaml mechanism):
191
206
192
207
``` bash
193
- BRUTEFORCE=true make compose/test
208
+ BRUTEFORCE=true LOG_LEVEL=debug make compose/test
194
209
```
195
210
196
211
## Development workflow using Docker / docker-compose
0 commit comments