Skip to content

Commit 00986cc

Browse files
author
Gonzalo Diaz
committed
[CONFIG] new BRUTEFORCE behavior added to README.md
1 parent cdca798 commit 00986cc

File tree

1 file changed

+62
-9
lines changed

1 file changed

+62
-9
lines changed

README.md

Lines changed: 62 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ require docker-compose and make installed.
8282
Using a dotnet 8.0 stack in your SO. You must install dependencies:
8383

8484
```bash
85-
dotnet restore --verbosity=normal
85+
dotnet restore --verbosity normal
8686
```
8787

8888
Every problem is a function with unit test.
@@ -95,30 +95,37 @@ Run all tests (skips static analysis, and "clean" test cache before running):
9595
dotnet test --verbosity normal
9696
```
9797

98+
Another way to increase verbosity level in console output:
99+
100+
```bash
101+
dotnet test --logger "console;verbosity=detailed"
102+
```
103+
98104
#### Test run with alternative behaviors
99105

100106
> [!IMPORTANT]
101-
> BRUTEFORCE and LOG_LEVEL environment variables not yet implemented.
107+
> LOG_LEVEL environment variable not yet implemented.
102108
>
103109
> Currently tests only have one behavior.
104110
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:
106112

107113
| Variable | Values | Default |
108114
| ------ | ------ | ------ |
109115
| LOG_LEVEL | `debug`, `warning`, `error`, `info` | `info` |
110116
| BRUTEFORCE | `true`, `false`| `false` |
111117

112118
- ~~`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).
115121

116122
#### Examples running tests with alternative behaviors
117123

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+
```
122129

123130
### Install and Run using make
124131

@@ -131,6 +138,18 @@ Run tests (libraries are installed as dependency task in make):
131138
make test
132139
```
133140

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+
134153
### Install and Running with Docker 🐳
135154

136155
Build an image of the test stage.
@@ -143,13 +162,37 @@ environment using docker-compose.
143162
docker-compose --profile testing run --rm algorithm-exercises-csharp-test
144163
```
145164

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+
146180
### Install and Running with Docker 🐳 using make
147181

148182
```bash
149183
make compose/build
150184
make compose/test
151185
```
152186

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+
153196
## Development workflow using Docker / docker-compose
154197

155198
Running container with development target.
@@ -166,6 +209,16 @@ docker-compose build --compress algorithm-exercises-csharp-dev
166209
docker-compose run --rm algorithm-exercises-csharp-dev dotnet test --verbosity normal
167210
```
168211

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+
169222
## Run complete workflow (Docker + make)
170223

171224
Following command simulates a standarized pipeline across environments,

0 commit comments

Comments
 (0)