@@ -82,7 +82,7 @@ require docker-compose and make installed.
82
82
Using a dotnet 8.0 stack in your SO. You must install dependencies:
83
83
84
84
``` bash
85
- dotnet restore --verbosity= normal
85
+ dotnet restore --verbosity normal
86
86
```
87
87
88
88
Every problem is a function with unit test.
@@ -95,30 +95,37 @@ Run all tests (skips static analysis, and "clean" test cache before running):
95
95
dotnet test --verbosity normal
96
96
```
97
97
98
+ Another way to increase verbosity level in console output:
99
+
100
+ ``` bash
101
+ dotnet test --logger " console;verbosity=detailed"
102
+ ```
103
+
98
104
#### Test run with alternative behaviors
99
105
100
106
> [ !IMPORTANT]
101
- > BRUTEFORCE and LOG_LEVEL environment variables not yet implemented.
107
+ > LOG_LEVEL environment variable not yet implemented.
102
108
>
103
109
> Currently tests only have one behavior.
104
110
105
- ~~ You can change test running behaviour using some environment variables as follows:~~
111
+ You can change test running behaviour using some environment variables as follows:
106
112
107
113
| Variable | Values | Default |
108
114
| ------ | ------ | ------ |
109
115
| LOG_LEVEL | ` debug ` , ` warning ` , ` error ` , ` info ` | ` info ` |
110
116
| BRUTEFORCE | ` true ` , ` false ` | ` false ` |
111
117
112
118
- ~~ ` LOG_LEVEL ` : change verbosity level in outputs.~~
113
- - ~~ ` BRUTEFORCE ` : enable or disable running large tests.
114
- (long time, large amount of data, high memory consumition).~~
119
+ - ` BRUTEFORCE ` : enable or disable running large tests.
120
+ (long time, large amount of data, high memory consumition).
115
121
116
122
#### Examples running tests with alternative behaviors
117
123
118
- > [ !IMPORTANT]
119
- > BRUTEFORCE and LOG_LEVEL environment variables not yet implemented.
120
- >
121
- > Currently tests only have one behavior.
124
+ Run brute-force tests with debug outputs:
125
+
126
+ ``` bash
127
+ BRUTEFORCE=true dotnet test --logger " console;verbosity=detailed"
128
+ ```
122
129
123
130
### Install and Run using make
124
131
@@ -131,6 +138,18 @@ Run tests (libraries are installed as dependency task in make):
131
138
make test
132
139
```
133
140
141
+ Run brute-force tests:
142
+
143
+ ``` bash
144
+ make test -e BRUTEFORCE=true
145
+ ```
146
+
147
+ Alternative way, use environment variables as prefix:
148
+
149
+ ``` bash
150
+ BRUTEFORCE=true make test
151
+ ```
152
+
134
153
### Install and Running with Docker 🐳
135
154
136
155
Build an image of the test stage.
@@ -143,13 +162,37 @@ environment using docker-compose.
143
162
docker-compose --profile testing run --rm algorithm-exercises-csharp-test
144
163
```
145
164
165
+ To change behavior using environment variables, you can pass to containers
166
+ in the following ways:
167
+
168
+ From host using docker-compose (compose.yaml) mechanism:
169
+
170
+ ``` bash
171
+ BRUTEFORCE=true docker-compose --profile testing run --rm algorithm-exercises-csharp-test
172
+ ```
173
+
174
+ Overriding docker CMD, as parameter of make "-e":
175
+
176
+ ``` bash
177
+ docker-compose --profile testing run --rm algorithm-exercises-java-test make test -e BRUTEFORCE=true
178
+ ```
179
+
146
180
### Install and Running with Docker 🐳 using make
147
181
148
182
``` bash
149
183
make compose/build
150
184
make compose/test
151
185
```
152
186
187
+ To pass environment variables you can use docker-compose
188
+ or overriding CMD and passing to make as "-e" argument.
189
+
190
+ Passing environment variables using docker-compose (compose.yaml mechanism):
191
+
192
+ ``` bash
193
+ BRUTEFORCE=true make compose/test
194
+ ```
195
+
153
196
## Development workflow using Docker / docker-compose
154
197
155
198
Running container with development target.
@@ -166,6 +209,16 @@ docker-compose build --compress algorithm-exercises-csharp-dev
166
209
docker-compose run --rm algorithm-exercises-csharp-dev dotnet test --verbosity normal
167
210
```
168
211
212
+ Or with detailed output to terminal:
213
+
214
+ ``` bash
215
+ # Build development target image
216
+ docker-compose build --compress algorithm-exercises-csharp-dev
217
+
218
+ # Run ephemeral container and override command to run test
219
+ docker-compose run --rm algorithm-exercises-csharp-dev dotnet test --logger " console;verbosity=detailed"
220
+ ```
221
+
169
222
## Run complete workflow (Docker + make)
170
223
171
224
Following command simulates a standarized pipeline across environments,
0 commit comments