Skip to content

Commit

Permalink
Do not fail the deep test check on in progress runs (#3363)
Browse files Browse the repository at this point in the history
If there is a deep test check, and multiple runs qualify for that check,
but the most recent run in still in progress, do not fail the check on
that run, but instead look at the first not in progress run.

Also add a missing return statement so we don't get don't confusing
error reporting like this:
<img width="1011" alt="image"
src="https://user-images.githubusercontent.com/3121201/212307198-f0041b1c-e6dc-4852-ab75-38816122eeff.png">

<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
  • Loading branch information
keyboardDrummer authored Jan 17, 2023
1 parent 6c6873c commit a75e209
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/check-for-workflow-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ module.exports = async ({github, context, core, workflow_id, sha, ...config}) =>
// run for this SHA we see.
const runFilterDesc = sha ? `${workflow_id} on ${sha}` : workflow_id
for (const run of result.data.workflow_runs) {
if (!sha || run.head_sha == sha) {
if (run.conclusion != "success") {
if ((!sha || run.head_sha === sha) && run.conclusion !== "in_progress") {
if (run.conclusion !== "success") {
core.setFailed(`Last run of ${runFilterDesc} did not succeed: ${run.html_url}`)
} else {
// The SHA is fully tested, exit with success
console.log(`Last run of ${runFilterDesc} succeeded: ${run.html_url}`)
return
}
return
}
}
core.setFailed(`No runs of ${runFilterDesc} found!`)
Expand Down

0 comments on commit a75e209

Please sign in to comment.