Commit 995e362
committed
amend! amend! ci(ui-tests): take a screenshot when canceled
ci(ui-tests): take a screenshot when canceled
Sometimes the logs are empty and it is highly unclear what has happened.
In such a scenario, a picture is indeed worth more than a thousand
words.
Note that this commit is more complicated than anyone would like, for
two reasons:
- While PowerShell is the right tool for the job, a PowerShell step in
GitHub Actions will pop up a Terminal window, _hiding_ what we want to
screenshot. To work around that, I tried to run things in a Bash step.
_Also_ opens a Terminal window! Node.js to the rescue.
- _Of course_ it is complicated to take a screenshot. The challenge is
to figure out the dimensions of the screen, which should be as easy as
looking at `[System.Windows.Forms.Screen]::PrimaryScreen`'s `Bounds`
attribute.
Easy peasy, right? No, it's not. Most machines nowadays have a
_ridiculous_ resolution which is why most setups have a _zoom factor_.
Getting to that factor should be trivial, by calling
`GetDeviceCaps(hDC, LOGPIXELSX)`, but that's not working in modern
Windows! There is a per-monitor display scaling ("DPI"). But even
_that_ is hard to get at, calling `GetDpiForMonitor()` will still
return 96 DPI (i.e. 100% zoom) because PowerShell is not marked as
_Per-Monitor DPI Aware_. Since we do not want to write a manifest into
the same directory as `powershell.exe` resides, we have to jump
through yet another hoop to get that.
Signed-off-by: Johannes Schindelin <[email protected]>1 parent 2ebd8f5 commit 995e362
1 file changed
+65
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
182 | 202 | | |
183 | 203 | | |
184 | 204 | | |
| |||
0 commit comments