Skip to content

Commit 82b73f8

Browse files
fix stdexec cleanup CI failures
Signed-off-by: guptapratykshh <pratykshgupta9999@gmail.com>
1 parent a24be1a commit 82b73f8

12 files changed

Lines changed: 167 additions & 80 deletions

File tree

.circleci/config.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,13 +636,17 @@ jobs:
636636
when: always
637637
command: |
638638
ulimit -c unlimited
639+
target_regex="$(
640+
grep -v -e ^# -e ^$ /hpx/source/.circleci/tests.unit2.algorithms \
641+
| paste -sd'|' -
642+
)"
643+
regex="^(${target_regex})$"
639644
ctest \
640645
--timeout 180 \
641646
-T test \
642647
--no-compress-output \
643648
--output-on-failure \
644-
--tests-regex \
645-
`grep -v -e ^# -e ^$ /hpx/source/.circleci/tests.unit2.algorithms | sed ':b;N;$!bb;s/\n/|/g'`
649+
--tests-regex "${regex}"
646650
- run:
647651
<<: *convert_xml
648652
- run:

.github/actions/collect-artifacts/action.yml

Lines changed: 55 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,71 @@ runs:
2020
using: "composite"
2121
steps:
2222
- name: Convert XML
23-
if: always()
23+
if: always()
2424
shell: bash
2525
run: |
2626
cd build
27-
mkdir -p ${{ inputs.job-name }}
28-
xsltproc \
29-
../.github/ci-scripts/conv.xsl Testing/$(head -n 1 < Testing/TAG)/Test.xml \
30-
> ${{ inputs.job-name }}/Test.xml
31-
27+
mkdir -p "${{ inputs.job-name }}"
28+
29+
test_xml=""
30+
conversion_failed=false
31+
if [[ -r Testing/TAG ]]; then
32+
test_xml="Testing/$(head -n 1 < Testing/TAG)/Test.xml"
33+
elif [[ -r Testing/Test.xml ]]; then
34+
test_xml="Testing/Test.xml"
35+
fi
36+
37+
if [[ -n "${test_xml}" && -r "${test_xml}" ]]; then
38+
if ! xsltproc \
39+
../.github/ci-scripts/conv.xsl "${test_xml}" \
40+
> "${{ inputs.job-name }}/Test.xml"; then
41+
conversion_failed=true
42+
rm -f "${{ inputs.job-name }}/Test.xml"
43+
cp "${test_xml}" "${{ inputs.job-name }}/CTest-Test.xml"
44+
fi
45+
fi
46+
47+
if [[ ! -f "${{ inputs.job-name }}/Test.xml" ]]; then
48+
if [[ "${conversion_failed}" == "true" ]]; then
49+
printf '%s\n' \
50+
'<testsuites>' \
51+
' <testsuite name="ctest-artifacts" tests="1" failures="0"'\
52+
' errors="1" skipped="0">' \
53+
' <testcase classname="collect-artifacts"'\
54+
' name="ctest-xml-conversion">' \
55+
' <error message="Failed to convert CTest XML with xsltproc"/>' \
56+
' </testcase>' \
57+
' </testsuite>' \
58+
'</testsuites>' \
59+
> "${{ inputs.job-name }}/Test.xml"
60+
else
61+
printf '%s\n' \
62+
'<testsuites>' \
63+
' <testsuite name="ctest" tests="0" failures="0"'\
64+
' errors="0" skipped="0"/>' \
65+
'</testsuites>' \
66+
> "${{ inputs.job-name }}/Test.xml"
67+
fi
68+
fi
69+
3270
- name: Move core dumps
3371
if: failure() && inputs.collect-failure-artifacts == 'true'
3472
shell: bash
3573
run: |
3674
cd build
37-
mkdir -p ${{ inputs.job-name }}
38-
cp core.* ${{ inputs.job-name }} || true
39-
75+
mkdir -p "${{ inputs.job-name }}"
76+
shopt -s nullglob
77+
core_files=(core.*)
78+
if (( ${#core_files[@]} != 0 )); then
79+
cp "${core_files[@]}" "${{ inputs.job-name }}"
80+
fi
81+
4082
- name: Move debug logs
4183
if: failure() && inputs.collect-failure-artifacts == 'true'
4284
shell: bash
4385
run: |
4486
cd build
45-
mkdir -p ${{ inputs.job-name }}
46-
cp debug-log.txt ${{ inputs.job-name }} || true
87+
mkdir -p "${{ inputs.job-name }}"
88+
if [[ -f debug-log.txt ]]; then
89+
cp debug-log.txt "${{ inputs.job-name }}"
90+
fi

0 commit comments

Comments
 (0)