Skip to content

Commit b342eb4

Browse files
committed
Update yq command
1 parent f8ef05e commit b342eb4

File tree

1 file changed

+19
-11
lines changed
  • .github/actions/send_qmods_slack_notification

1 file changed

+19
-11
lines changed

.github/actions/send_qmods_slack_notification/action.yml

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,25 @@ runs:
1414
run: |
1515
echo FAILING_TESTS=$(
1616
yq -o json -I 0 -p xml '
17-
.testsuites[].testcase[] | select(.failure // .error) |
18-
select((.failure // .error)["+@message"] | test("^((AssertionError: Qmod file)|(AssertionError: Found uncommitted Qmod)).*")) |
19-
{
20-
"name": (.["+@classname"] + "::" + .["+@name"]),
21-
"message": (.failure // .error)["+@message"]
22-
}
23-
' ./pytest-results/test-results.xml | \
24-
jq -r -s '
25-
sort_by(.name) | .[] |
26-
"• " + .name + ": " + (.message | @html | split("\n") | .[0]) + "\n\n"
27-
'
17+
.testsuites[].testcase[]
18+
| select(.failure // .error)
19+
| select(
20+
(.failure // .error)["+content"]
21+
| test("(?:^|\n)E?(?:\s*)?(?:\|\s*)?(?:ValueError: (?:Qmod file)|(?:Found uncommitted Qmod))")
22+
)
23+
| {
24+
"name": (.["+@classname"] + "::" + .["+@name"]),
25+
"message": (
26+
(.failure // .error)["+content"]
27+
| match("(?:^|\n)E?(?:\s*)?(?:\|\s*)?((?:ValueError: (?:Qmod file)|(?:Found uncommitted Qmod))[^\n$]+)")
28+
.captures[0].string
29+
)
30+
}
31+
' ./pytest-results/test-results.xml | \
32+
jq -r -s '
33+
sort_by(.name) | .[] |
34+
"• " + .name + ": " + (.message | @html | split("\n") | .[0]) + "\n\n"
35+
'
2836
) >> $GITHUB_ENV
2937
3038
- name: Send JSON to slack workflow

0 commit comments

Comments
 (0)