-
Notifications
You must be signed in to change notification settings - Fork 4
208 lines (179 loc) · 8.38 KB
/
Copy pathconformance.yml
File metadata and controls
208 lines (179 loc) · 8.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
name: Kernel Conformance
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
pull-requests: write
jobs:
test-kernel:
name: Test ${{ matrix.kernel.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kernel:
- name: ipykernel
install: pip install ipykernel && python -m ipykernel install --user
kernel-name: python3
- name: evcxr
install: cargo install --locked evcxr_jupyter && evcxr_jupyter --install
kernel-name: rust
- name: deno
install: |
curl -fsSL https://deno.land/install.sh | sh
echo "$HOME/.deno/bin" >> $GITHUB_PATH
$HOME/.deno/bin/deno jupyter --install
kernel-name: deno
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Set up Python
if: matrix.kernel.name == 'ipykernel'
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/
~/.cargo/git/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install kernel
run: ${{ matrix.kernel.install }}
- name: Build test suite
run: cargo build --release
- name: List available kernels
run: ./target/release/jupyter-kernel-test --list-kernels
- name: Run conformance tests
run: |
./target/release/jupyter-kernel-test ${{ matrix.kernel.kernel-name }} \
--format json \
--output ${{ matrix.kernel.name }}-report.json
continue-on-error: true
- name: Display results
run: ./target/release/jupyter-kernel-test ${{ matrix.kernel.kernel-name }} || true
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: report-${{ matrix.kernel.name }}
path: ${{ matrix.kernel.name }}-report.json
if-no-files-found: warn
conformance-matrix:
name: Conformance Matrix
needs: test-kernel
runs-on: ubuntu-latest
if: always()
steps:
- uses: actions/checkout@v4
- name: Download all reports
uses: actions/download-artifact@v4
with:
path: reports
pattern: report-*
merge-multiple: true
- name: Generate detailed report
run: |
{
echo "## Kernel Conformance Matrix"
echo ""
echo "| Kernel | Tier 1 | Tier 2 | Tier 3 | Tier 4 | Total |"
echo "|--------|--------|--------|--------|--------|-------|"
for report in reports/*-report.json; do
if [ -f "$report" ]; then
kernel=$(basename "$report" -report.json)
tier1=$(jq '[.results[] | select(.category == "tier1_basic") | select(.result.status == "pass")] | length' "$report" 2>/dev/null || echo "?")
tier1_total=$(jq '[.results[] | select(.category == "tier1_basic")] | length' "$report" 2>/dev/null || echo "?")
tier2=$(jq '[.results[] | select(.category == "tier2_interactive") | select(.result.status == "pass")] | length' "$report" 2>/dev/null || echo "?")
tier2_total=$(jq '[.results[] | select(.category == "tier2_interactive")] | length' "$report" 2>/dev/null || echo "?")
tier3=$(jq '[.results[] | select(.category == "tier3_rich_output") | select(.result.status == "pass")] | length' "$report" 2>/dev/null || echo "?")
tier3_total=$(jq '[.results[] | select(.category == "tier3_rich_output")] | length' "$report" 2>/dev/null || echo "?")
tier4=$(jq '[.results[] | select(.category == "tier4_advanced") | select(.result.status == "pass")] | length' "$report" 2>/dev/null || echo "?")
tier4_total=$(jq '[.results[] | select(.category == "tier4_advanced")] | length' "$report" 2>/dev/null || echo "?")
total=$(jq '[.results[] | select(.result.status == "pass")] | length' "$report" 2>/dev/null || echo "?")
total_tests=$(jq '.results | length' "$report" 2>/dev/null || echo "?")
echo "| $kernel | $tier1/$tier1_total | $tier2/$tier2_total | $tier3/$tier3_total | $tier4/$tier4_total | $total/$total_tests |"
fi
done
echo ""
echo "---"
echo ""
# Detailed failure breakdown per kernel
for report in reports/*-report.json; do
if [ -f "$report" ]; then
kernel=$(basename "$report" -report.json)
impl=$(jq -r '.implementation // "unknown"' "$report" 2>/dev/null)
lang=$(jq -r '.language // "unknown"' "$report" 2>/dev/null)
protocol=$(jq -r '.protocol_version // "unknown"' "$report" 2>/dev/null)
failures=$(jq '[.results[] | select(.result.status != "pass" and .result.status != "unsupported")] | length' "$report" 2>/dev/null || echo "0")
skipped=$(jq '[.results[] | select(.result.status == "unsupported")] | length' "$report" 2>/dev/null || echo "0")
if [ "$failures" != "0" ] || [ "$skipped" != "0" ]; then
echo "<details>"
echo "<summary><strong>$kernel</strong> ($impl) - $failures failures, $skipped skipped</summary>"
echo ""
echo "**Language:** $lang | **Protocol:** $protocol"
echo ""
if [ "$failures" != "0" ]; then
echo "#### Failures"
echo ""
echo "| Test | Message Type | Description | Reason |"
echo "|------|--------------|-------------|--------|"
jq -r '.results[] | select(.result.status == "fail" or .result.status == "timeout") | "| \(.name) | `\(.message_type)` | \(.description) | \(.result.reason // "timeout") |"' "$report" 2>/dev/null
echo ""
fi
if [ "$skipped" != "0" ]; then
echo "#### Skipped (Not Implemented)"
echo ""
jq -r '.results[] | select(.result.status == "unsupported") | "- **\(.name)**: \(.description)"' "$report" 2>/dev/null
echo ""
fi
echo "</details>"
echo ""
fi
fi
done
# Cross-kernel comparison for failing tests
echo "---"
echo ""
echo "### Test Results by Message Type"
echo ""
echo "| Test | Message Type |$(for r in reports/*-report.json; do kernel=$(basename "$r" -report.json); echo -n " $kernel |"; done)"
echo "|------|--------------|$(for r in reports/*-report.json; do echo -n "--------|"; done)"
# Get all unique test names
all_tests=$(jq -r '.results[].name' reports/*-report.json 2>/dev/null | sort -u)
for test in $all_tests; do
msg_type=$(jq -r --arg t "$test" '.results[] | select(.name == $t) | .message_type' reports/*-report.json 2>/dev/null | head -1)
echo -n "| $test | \`$msg_type\` |"
for report in reports/*-report.json; do
if [ -f "$report" ]; then
status=$(jq -r --arg t "$test" '.results[] | select(.name == $t) | .result.status' "$report" 2>/dev/null)
case "$status" in
pass) echo -n " ✅ |" ;;
fail) echo -n " ❌ |" ;;
unsupported) echo -n " ⏭️ |" ;;
timeout) echo -n " ⏱️ |" ;;
partial_pass) echo -n " ⚠️ |" ;;
*) echo -n " - |" ;;
esac
fi
done
echo ""
done
} | tee -a $GITHUB_STEP_SUMMARY > summary.md
- name: Comment on PR
if: github.event_name == 'pull_request'
env:
GH_TOKEN: ${{ github.token }}
run: gh pr comment ${{ github.event.pull_request.number }} --body-file summary.md
- name: Upload combined reports
uses: actions/upload-artifact@v4
with:
name: conformance-reports
path: reports/
if-no-files-found: warn