Conversation
Greptile SummaryThis PR fixes a CI gap where a missing screenshot file during a Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[takeScreenshot called] --> B{opts.verify?}
B -->|yes| C{file exists?}
C -->|yes| D[expected = readFile]
C -->|no| E[expected = null]
B -->|no| F[expected = null]
D & E & F --> G[while retry loop]
G --> H[take screenshot, assign buf]
H --> I{opts.verify AND not expected?}
I -->|yes| J[log error missing screenshot, break]
I -->|no| K{expected?}
K -->|yes| L{buf equals expected?}
L -->|yes| M[log ok, return success]
L -->|no| N[log error, retry]
K -->|no| O[writeFile baseline, return success]
J --> Q
N --> P{retries exhausted?}
P -->|no| G
P -->|yes| Q[console.error FAIL, exitStatus=3]
Q --> R{opts.diff or opts.new?}
R -->|yes| S[writeFile buf to outputDir]
S --> T{opts.diff AND expected?}
T -->|yes| U[generate diff image via convert]
T -->|no| V{opts.new?}
U --> V
V -->|no| W[unlink bufFile]
V -->|yes| X[keep bufFile in newDir]
R -->|no| Y[end]
|
|
Looks great! |
|
🎉 This PR is included in version 0.16.38 🎉 The release is available on: Your semantic-release bot 📦🚀 |
As noted in #4147 (review)
What is the previous behavior before this PR?
If a screenshot file is missing, CI would pass. #4147 is currently an example.
What is the new behavior after this PR?
CI now fails. Specifically,
--verifycauses failure if there's no image file to compare against.--newstill causes the new screenshot to be saved (which is useful for artifact uploading).