Skip to content

Commit 166fb48

Browse files
authored
Merge pull request #13 from RustPython/skip-notes
Show notes for skipped tests if they exist and add support for expectedFailure test results
2 parents 736a676 + dea4d42 commit 166fb48

8 files changed

+68
-29
lines changed

‎Gemfile.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@ DEPENDENCIES
8181
wdm (~> 0.1.1)
8282

8383
BUNDLED WITH
84-
1.17.2
84+
2.1.4

‎_data/regrtests_results.json

+1-1
Large diffs are not rendered by default.

‎_includes/regrtest_summary.html

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
{% assign result_total = include.pass | plus: include.skip | plus: include.fail %}
1+
{% assign result_total = include.pass | plus: include.expectedfail | plus: include.skip %}
22
{% assign pass_percent = include.pass | times: 100.0 | divided_by: result_total | round: 2 %}
3+
{% assign expectedfail_percent = include.expectedfail | times: 100.0 | divided_by: result_total | round: 2 %}
34
{% assign skip_percent = include.skip | times: 100.0 | divided_by: result_total | round: 2 %}
4-
{% assign fail_percent = include.fail | times: 100.0 | divided_by: result_total | round: 2 %}
55

66
{% assign pass_color = "#4c1" %}
7-
{% assign skip_color = "#e4df12" %}
8-
{% assign fail_color = "#fe7d37" %}
7+
{% assign expectedfail_color = "#e4df12" %}
8+
{% assign skip_color = "#fe7d37" %}
99
{% assign bar_height = "20px" %}
1010

1111
{%if include.svg %}
@@ -14,16 +14,16 @@
1414
<g shape-rendering="crispEdges">
1515
<rect width="49" height="20" fill="#555" />
1616
<rect x="49" width="65" height="20" fill="{{ pass_color }}" />
17-
<rect x="114" width="65" height="20" fill="{{ skip_color }}" />
18-
<rect x="179" width="65" height="20" fill="{{ fail_color }}" />
17+
<rect x="114" width="65" height="20" fill="{{ expectedfail_color }}" />
18+
<rect x="179" width="65" height="20" fill="{{ skip_color }}" />
1919
</g>
2020
<g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif"
2121
text-rendering="geometricPrecision" font-size="110">
2222
<text x="255" y="140" transform="scale(.1)"
2323
textLength="390">Results</text>
2424
<text x="805" y="140" transform="scale(.1)" textLength="550">Pass {{ pass_percent | round: 1 }}%</text>
25-
<text x="1455" y="140" transform="scale(.1)" textLength="550">Skip {{ skip_percent | round: 1 }}%</text>
26-
<text x="2105" y="140" transform="scale(.1)" textLength="550">Fail {{ fail_percent | round: 1 }}%</text>
25+
<text x="1455" y="140" transform="scale(.1)" textLength="550">Expected Failure {{ expectedfail_percent | round: 1 }}%</text>
26+
<text x="2105" y="140" transform="scale(.1)" textLength="550">Skip {{ skip_percent | round: 1 }}%</text>
2727
</g>
2828
</svg>
2929

@@ -50,20 +50,20 @@
5050
<span class="font-secondary">Passed: </span>
5151
{{ include.pass }} ({{ pass_percent }}%)
5252
</div>
53+
<div class ="cell_summary">
54+
<span class="font-secondary">Expected Failure: </span>
55+
{{ include.expectedfail }} ({{ expectedfail_percent }}%)
56+
</div>
5357
<div class="cell_summary">
5458
<span class="font-secondary">Skipped: </span>
5559
{{ include.skip }} ({{ skip_percent }}%)
5660
</div>
57-
<div class ="cell_summary">
58-
<span class="font-secondary">Failed: </span>
59-
{{ include.fail }} ({{ fail_percent }}%)
60-
</div>
6161
</div>
6262
<div class="row"
6363
style="background: linear-gradient(to right,
6464
{{ pass_color }} {{ pass_percent }}%,
65-
{{ skip_color }} {{ pass_percent }}% {{ skip_percent | plus: pass_percent }}%,
66-
{{ fail_color }} {{ skip_percent | plus: pass_percent }}% {{ fail_percent | plus: pass_percent | plus: skip_percent }}%
65+
{{ expectedfail_color }} {{ pass_percent }}% {{ expectedfail_percent | plus: pass_percent }}%,
66+
{{ skip_color }} {{ expectedfail_percent | plus: pass_percent }}% {{ skip_percent | plus: pass_percent | plus: expectedfail_percent }}%
6767
);
6868
height: {{ bar_height }};">
6969

‎_layouts/regrtests_results.html

+31-8
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@
2020
<div data-filter="all" class="filter active pr-2"> All </div>
2121
<div data-filter="passed" class="filter pr-2"> Passed </div>
2222
<div data-filter="skipped" class="filter pr-2"> Skipped </div>
23-
<div data-filter="" class="filter"> Empty </div>
23+
<div data-filter="expected_failure" class="filter pr-2"> Expected Failures </div>
24+
<div data-filter="" class="filter ml-auto"> Summary only </div>
2425
</div>
2526
</div>
2627

2728
<!-- content -->
29+
{% capture tables %}
2830
<div class="w-80 m-auto">
2931
<div class="m-auto">
3032

@@ -36,8 +38,8 @@ <h2 class="font-secondary">Summary:</span>
3638
{% assign regrtests_results = site.data.regrtests_results %}
3739
{% include regrtest_summary.html
3840
pass=regrtests_results.num_passed
41+
expectedfail=regrtests_results.num_expected_failures
3942
skip=regrtests_results.num_skipped
40-
fail=regrtests_results.num_failed
4143
extime=regrtests_results.execution_time
4244
%}
4345
</div>
@@ -76,7 +78,7 @@ <h2 class="font-secondary">Summary:</span>
7678
</div>
7779
{% if result.num_passed and result.num_skipped and result.num_failed %}
7880
<div class="w-md-50 float-md-right">
79-
{% include regrtest_summary.html pass=result.num_passed skip=result.num_skipped fail=result.num_failed extime=result.execution_time %}
81+
{% include regrtest_summary.html pass=result.num_passed expectedfail=result.num_expected_failures skip=result.num_skipped extime=result.execution_time %}
8082
</div>
8183
{% endif %}
8284
</div>
@@ -85,7 +87,7 @@ <h2 class="font-secondary">Summary:</span>
8587
{% for cases in result.cases %}
8688
<div class="results-case">
8789
<div class="tbl results-case-list">
88-
<!-- for each case -->
90+
{% comment %} for each case {% endcomment %}
8991
{% for case in cases %}
9092
<div data-status="{{case.result}}" class="row results-case-list-details">
9193

@@ -97,9 +99,25 @@ <h2 class="font-secondary">Summary:</span>
9799
{% endif %}
98100

99101
{% if case.result %}
100-
<div class="cell {{case.result }} results-case-list-item text-mobile-right">
101-
<span class="text-small text-muted d-mobile-none">RESULT:</span>
102-
{{case.result }}
102+
<div class="cell {{ case.result }} results-case-list-item text-mobile-right">
103+
<span class="text-small text-muted d-mobile-none">RESULT: </span>
104+
<span class="case-result">{{ case.result | replace: "_", " " }}</span>
105+
{%- if case.result == "skipped" -%}
106+
{%- assign note = case.note | default: result.note-%}
107+
{%- assign lownote = note | downcase -%}
108+
{%- if lownote contains "todo: rustpython" -%}
109+
{%- assign note = lownote | remove: "todo: rustpython," | remove: "todo: rustpython:" | remove: "todo: rustpython" | strip -%}
110+
{%- if note and note != "" %}
111+
<span class="text-small text-muted d-mobile-none">TO RESOLVE: </span>
112+
<span class="d-mobile-none case-note">{{ note }}</span>
113+
{%- endif -%}
114+
{%- elsif note == "implementation detail specific to cpython" -%}
115+
<span class="text-small text-muted d-mobile-none">(CPython only)</span>
116+
{%- else -%}
117+
<span class="text-small text-muted d-mobile-none">not skipped by us: </span>
118+
<span class="text-small d-mobile-none case-note">{{ note }}</span>
119+
{%- endif -%}
120+
{%- endif -%}
103121
</div>
104122
{% endif %}
105123

@@ -112,7 +130,7 @@ <h2 class="font-secondary">Summary:</span>
112130

113131
</div>
114132
{% endfor %}
115-
<!-- end for each case -->
133+
{% comment %} end for each case {% endcomment %}
116134
</div>
117135
</div>
118136
{% endfor %}
@@ -124,5 +142,10 @@ <h2 class="font-secondary">Summary:</span>
124142
{% endfor %}
125143
</div>
126144
</div>
145+
{% endcapture %}
146+
147+
{%- assign tables = tables | split: "
148+
"-%}
149+
{%- for line in tables -%}{{ line | strip }}{%- endfor -%}
127150

128151
<script src="/assets/js/regrtests_results.js"></script>

‎_posts/2020-04-05-how-to-contribute-by-cpython-unittest.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Let's find an incompatibility issue and fix it.
1313

1414
1. See `Lib/test` directory of the project. There are many `test_` prefixed files like `test_unicode.py`.
1515
2. Try to open one of them. It might look just fine at a glance - but search for `TODO: RUSTPYTHON` in the files. There are tons of skipped, marked as an expected failure or commented out tests.
16+
1. Alternatively, try looking at the [regression tests results]({% link pages/regression-tests-results.markdown %}) to find skipped or expected failure tests; some of them have
17+
notes for a way to resolve the issue.
1618
3. Choose one or two interesting bugs. Remove the test blocker - skip, expectedFailure or comments.
1719
4. Try to fix them.
1820

‎assets/media.css

+3
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@
8080
text-align: right;
8181
}
8282

83+
.ml-auto {
84+
margin-left: auto !important;
85+
}
8386
}
8487

8588
/* fixes for ipad */

‎assets/style.css

+11-4
Original file line numberDiff line numberDiff line change
@@ -315,13 +315,20 @@ ul.list-inline {
315315
padding: 5px;
316316
}
317317

318-
.passed::after {
319-
content: " 🚀 👌";
318+
.case-result::after {
320319
padding: 5px;
321320
}
322321

323-
.skipped::after {
324-
content: " 🤷‍♀️";
322+
.passed > .case-result::after {
323+
content: "🚀 👌";
324+
}
325+
326+
.skipped > .case-result::after {
327+
content: "🤷‍♀️";
328+
}
329+
330+
.expected_failure > .case-result::after {
331+
content: "😔";
325332
}
326333

327334
/* filters */

‎index.markdown

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ Each of these implementations offer some benefits: Jython, for example, compiles
3636

3737
IronPython is well-integrated with .NET, which means IronPython can use the .NET framework and Python libraries or vice versa.
3838

39-
We want to unlock the same possibilities that Jython and IronPython enable, but for the Rust programming language. Then we want to do more. Using RustPython, we want to compile Python to WebAssembly and allow users to run their Python code natively in the browser.
39+
We want to unlock the same possibilities that Jython and IronPython enable, but for the Rust programming language. In addition, thanks to Rusts' minimal runtime, we're able to compile RustPython to WebAssembly and allow users to run their Python code easily in the browser.
4040

4141
Check the "learn more" section for an explainer of all those jargon-y words, or read the blog for more in-depth technical discussion.
42+
43+
### Other Resources
44+
45+
- [CPython test compatibility]({% link pages/regression-tests-results.markdown %})

0 commit comments

Comments
 (0)