Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,9 @@ jobs:
name: Check job status
if: always()
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
needs:
- should-skip
- detect-changes
Expand All @@ -426,6 +429,121 @@ jobs:
- test-windows
- doc
steps:
- name: Report universally-skipped tests
env:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail

REPO="${GITHUB_REPOSITORY}"
WORKDIR=$(mktemp -d)
trap 'rm -rf "${WORKDIR}"' EXIT

mkdir -p "${WORKDIR}/configs"

# Collect all jobs for this run and group matrix jobs into wheel
# test configurations from ci.yml.
jobs_json=$(gh api --paginate \
"repos/${REPO}/actions/runs/${GITHUB_RUN_ID}/jobs?per_page=100" \
| jq -s '[.[].jobs[]]')

declare -A CONFIG_PATTERNS=(
[test-linux-64]='^Test linux-64 / '
[test-linux-aarch64]='^Test linux-aarch64 / '
[test-windows]='^Test (win-64|windows) / '
)

configs=(
test-linux-64
test-linux-aarch64
test-windows
)

for cfg in "${configs[@]}"; do
cfg_dir="${WORKDIR}/configs/${cfg}"
mkdir -p "${cfg_dir}/logs"
job_ids=$(echo "${jobs_json}" | jq -r \
--arg pat "${CONFIG_PATTERNS[$cfg]}" \
'.[] | select(.name | test($pat)) | .id')

if [[ -z "${job_ids}" ]]; then
echo "No matrix jobs found for ${cfg}" >&2
: > "${cfg_dir}/skipped.txt"
continue
fi

for job_id in ${job_ids}; do
logfile="${cfg_dir}/logs/${job_id}.log"
# Prefer the job log API; fall back to gh run view if needed.
if ! gh api "repos/${REPO}/actions/jobs/${job_id}/logs" > "${logfile}" 2>/dev/null; then
gh run view "${GITHUB_RUN_ID}" --job "${job_id}" --log > "${logfile}" || true
fi
done

# Extract pytest node IDs from SKIPPED lines. This tolerates
# timestamped logs, ANSI escapes, and trailing skip reasons.
grep -h 'SKIPPED' "${cfg_dir}/logs/"*.log 2>/dev/null \
| sed -E 's/\x1B\[[0-9;]*[[:alpha:]]//g' \
| sed 's#\\#/#g' \
| sed -nE 's#.*(tests/[[:graph:]]+\.py::[^[:space:]]+).*SKIPPED.*#\1#p' \
| sort -u > "${cfg_dir}/skipped.txt" || true

echo "${cfg}: $(wc -l < "${cfg_dir}/skipped.txt") skipped tests"
done

{
echo "## Universally-skipped tests"
echo ""
} >> "${GITHUB_STEP_SUMMARY}"

available_configs=0
missing_configs=()
for cfg in "${configs[@]}"; do
if [[ -s "${WORKDIR}/configs/${cfg}/skipped.txt" || -n "$(ls -A "${WORKDIR}/configs/${cfg}/logs" 2>/dev/null || true)" ]]; then
available_configs=$((available_configs + 1))
else
missing_configs+=("${cfg}")
fi
done

if [[ ${available_configs} -eq 0 ]]; then
echo "_No test job logs found in this run._" >> "${GITHUB_STEP_SUMMARY}"
exit 0
fi

if [[ ${#missing_configs[@]} -gt 0 ]]; then
{
echo "_Warning: missing logs for configuration(s): ${missing_configs[*]}_"
echo ""
} >> "${GITHUB_STEP_SUMMARY}"
fi

# Start intersection from the first wheel configuration, then narrow.
cp "${WORKDIR}/configs/${configs[0]}/skipped.txt" "${WORKDIR}/intersection.txt"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My $0.02: At this complexity, I'd looking at shelling out to python instead of trying to do this much data wrangling in the shell.

for cfg in "${configs[@]:1}"; do
comm -12 \
"${WORKDIR}/intersection.txt" \
"${WORKDIR}/configs/${cfg}/skipped.txt" \
> "${WORKDIR}/intersection_new.txt"
mv "${WORKDIR}/intersection_new.txt" "${WORKDIR}/intersection.txt"
done

count=$(wc -l < "${WORKDIR}/intersection.txt")
{
echo "Tests skipped across wheel test configurations (${#configs[@]}):"
echo ""
if [[ ${count} -eq 0 ]]; then
echo "_No tests were skipped in all configurations._"
else
echo "| Test |"
echo "| --- |"
while IFS= read -r test; do
[[ -z "${test}" ]] && continue
echo "| \`${test}\` |"
done < "${WORKDIR}/intersection.txt"
fi
} >> "${GITHUB_STEP_SUMMARY}"

- name: Exit
run: |
# if any dependencies were cancelled or failed, that's a failure
Expand Down
5 changes: 5 additions & 0 deletions cuda_bindings/tests/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ def callableBinary(name):
return shutil.which(name) is not None


@pytest.mark.skipif(True, reason="Always skip!")
def test_always_skip():
pass


def test_cuda_memcpy():
# Get device

Expand Down
Loading