Commit 8826494
authored
chore(bigquery): add dynamic logging banner to nox mypy session (#17492)
This PR adds a dynamic logging banner
`Finished session for <package>`
to nox `mypy` sessions in `bigquery` to simplify troubleshooting.
Currently when a nox session runs, there may be many lines of text
between a reference to which package is being tested and the result
summary line. This can make it more difficult to determine which package
is affected without a lot of manual scrolling (every time you need to
trouble shoot an issue). This is especially true if you use `Ctrl+F` to
zoom over to summaries with words like `failed`.
```
change detected in packages/bigframes/
[many lines of text...]
2547 passed, 157 skipped, 9 xfailed, 1 xpassed, 586 warnings in 136.68s (0:02:16)
nox > Session unit-3.11(test_extra=True) failed in 3 minutes.
```
The PR adds a banner line right before the nox result summary:
```
change detected in packages/bigframes/
[many lines of text...]
2547 passed, 157 skipped, 9 xfailed, 1 xpassed, 586 warnings in 136.68s (0:02:16)
nox > Finished session for bigframes # NEW LINE, right before the summary line
nox > Session unit-3.11(test_extra=True) failed in 3 minutes.
```
> [!note]
> There is no convenient way to inject a log line into the nox session
and have it print **exactly** where you want. Also, because the long
term intent is to add this to all nox sessions I included an easy to
apply `contextmanager` to ensure the correct placement of the new
logging banner.
> [!note]
> This PR only adds this capability to a single nox session (`mypy`) and
a single handwritten package (`bigquery`). I did not want to invest a
lot of time unless the team feels it is beneficial. In which case, we
can add a task the next sprint to make this a global change.1 parent 6febabf commit 8826494
1 file changed
Lines changed: 23 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
83 | 104 | | |
84 | 105 | | |
85 | 106 | | |
| |||
193 | 214 | | |
194 | 215 | | |
195 | 216 | | |
196 | | - | |
| 217 | + | |
| 218 | + | |
197 | 219 | | |
198 | 220 | | |
199 | 221 | | |
| |||
0 commit comments