Skip to content

Commit 4d57d50

Browse files
author
Gonzalo Diaz
committed
[CONFIG] new LOGL_LEVEL behavior added to README.md
1 parent b85cfd6 commit 4d57d50

File tree

1 file changed

+29
-14
lines changed

1 file changed

+29
-14
lines changed

README.md

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,40 +91,45 @@ Unit test has test cases and input data to solve the problem.
9191

9292
Run all tests (skips static analysis, and "clean" test cache before running):
9393

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+
9498
```bash
95-
dotnet test --verbosity normal
99+
dotnet clean && dotnet test --verbosity normal
96100
```
97101

98-
Another way to increase verbosity level in console output:
102+
To enable console detailed output use:
99103

100104
```bash
101105
dotnet test --logger "console;verbosity=detailed"
102106
```
103107

104108
#### Test run with alternative behaviors
105109

106-
> [!IMPORTANT]
107-
> LOG_LEVEL environment variable not yet implemented.
108-
>
109-
> Currently tests only have one behavior.
110-
111110
You can change test running behaviour using some environment variables as follows:
112111

113112
| Variable | Values | Default |
114113
| ------ | ------ | ------ |
115114
| LOG_LEVEL | `debug`, `warning`, `error`, `info` | `info` |
116115
| BRUTEFORCE | `true`, `false`| `false` |
117116

118-
- ~~`LOG_LEVEL`: change verbosity level in outputs.~~
117+
- `LOG_LEVEL`: change verbosity level in outputs.
119118
- `BRUTEFORCE`: enable or disable running large tests.
120119
(long time, large amount of data, high memory consumition).
121120

122121
#### Examples running tests with alternative behaviors
123122

123+
Run tests with debug outputs:
124+
125+
```bash
126+
LOG_LEVEL=debug dotnet test --logger "console;verbosity=detailed"
127+
```
128+
124129
Run brute-force tests with debug outputs:
125130

126131
```bash
127-
BRUTEFORCE=true dotnet test --logger "console;verbosity=detailed"
132+
BRUTEFORCE=true LOG_LEVEL=debug dotnet test --logger "console;verbosity=detailed"
128133
```
129134

130135
### Install and Run using make
@@ -138,16 +143,22 @@ Run tests (libraries are installed as dependency task in make):
138143
make test
139144
```
140145

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:
142153

143154
```bash
144-
make test -e BRUTEFORCE=true
155+
make test -e BRUTEFORCE=true -e LOG_LEVEL=debug
145156
```
146157

147158
Alternative way, use environment variables as prefix:
148159

149160
```bash
150-
BRUTEFORCE=true make test
161+
BRUTEFORCE=true LOG_LEVEL=debug make test
151162
```
152163

153164
### Install and Running with Docker 🐳
@@ -174,7 +185,11 @@ BRUTEFORCE=true docker-compose --profile testing run --rm algorithm-exercises-cs
174185
Overriding docker CMD, as parameter of make "-e":
175186

176187
```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
178193
```
179194

180195
### Install and Running with Docker 🐳 using make
@@ -190,7 +205,7 @@ or overriding CMD and passing to make as "-e" argument.
190205
Passing environment variables using docker-compose (compose.yaml mechanism):
191206

192207
```bash
193-
BRUTEFORCE=true make compose/test
208+
BRUTEFORCE=true LOG_LEVEL=debug make compose/test
194209
```
195210

196211
## Development workflow using Docker / docker-compose

0 commit comments

Comments
 (0)