Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New icons! #35

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ measurement names (e.g. `measure1, measure2`) to include in the summary.
![Picture of a PR comment with icons indicating in progress benchmarks](./docs/in-progress-comment-with-results.png)

If the `report-id` option is provided, then `tachometer-reporter-action` will
add a stopwatch icon () next to any benchmark that is currently running. If the
action can determine the current job id, then the icon is a link to the action
job that is running the benchmark (see #7).
add an hourglass icon () next to any benchmark that is currently running. If
the action can determine the current job id, then the icon is a link to the
action job that is running the benchmark (see #7).

### Multiple measurements in one benchmark

Expand Down
12 changes: 6 additions & 6 deletions dist/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8243,10 +8243,10 @@ function formatDifference({ absolute, percentChange: relative }) {
let word, rel, abs;
if (Math.round(relative.low) == 0 && Math.round(relative.high) == 0) {
// Our formatting for percents uses `.toFixed(0)`. In cases where we would
// show 0% - 0% but the actual result is actually not zero (i.e. -0.5 - 0.4)
// let's still show the result as unsure to avoid a situation where we would
// display something like "slower ❌ 0% - 0% (0.00ms - 0.00ms)"
word = `<strong>unsure 🔍</strong>`; // bold blue
// show 0% - 0% but the actual result is actually not zero (i.e. -0.5% to
// 0.4%) let's still show the result as unsure to avoid a situation where we
// would display something like "slower ❌ 0% - 0% (0.00ms - 0.00ms)"
word = `<strong>same</strong>`; // bold blue
rel = formatConfidenceInterval(relative, (n) => colorizeSign(n, percent));
abs = formatConfidenceInterval(absolute, (n) => colorizeSign(n, milli));
} else if (absolute.low > 0 && relative.low > 0) {
Expand All @@ -8258,7 +8258,7 @@ function formatDifference({ absolute, percentChange: relative }) {
rel = formatConfidenceInterval(negate(relative), percent);
abs = formatConfidenceInterval(negate(absolute), milli);
} else {
word = `<strong>unsure 🔍</strong>`; // bold blue
word = `<strong>unsure </strong>`; // bold blue
rel = formatConfidenceInterval(relative, (n) => colorizeSign(n, percent));
abs = formatConfidenceInterval(absolute, (n) => colorizeSign(n, milli));
}
Expand Down Expand Up @@ -8678,7 +8678,7 @@ function Status({ actionInfo, icon }) {
"aria-label": icon ? label : null,
};

return h(tag, props, icon ? " " : label);
return h(tag, props, icon ? " " : label);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/getCommentBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function Status({ actionInfo, icon }) {
"aria-label": icon ? label : null,
};

return h(tag, props, icon ? " " : label);
return h(tag, props, icon ? " " : label);
}

/**
Expand Down
10 changes: 5 additions & 5 deletions src/utils/tachometer.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ function formatDifference({ absolute, percentChange: relative }) {
let word, rel, abs;
if (Math.round(relative.low) == 0 && Math.round(relative.high) == 0) {
// Our formatting for percents uses `.toFixed(0)`. In cases where we would
// show 0% - 0% but the actual result is actually not zero (i.e. -0.5 - 0.4)
// let's still show the result as unsure to avoid a situation where we would
// display something like "slower ❌ 0% - 0% (0.00ms - 0.00ms)"
word = `<strong>unsure 🔍</strong>`; // bold blue
// show 0% - 0% but the actual result is actually not zero (i.e. -0.5% to
// 0.4%) let's still show the result as unsure to avoid a situation where we
// would display something like "slower ❌ 0% - 0% (0.00ms - 0.00ms)"
word = `<strong>same</strong>`; // bold blue
rel = formatConfidenceInterval(relative, (n) => colorizeSign(n, percent));
abs = formatConfidenceInterval(absolute, (n) => colorizeSign(n, milli));
} else if (absolute.low > 0 && relative.low > 0) {
Expand All @@ -144,7 +144,7 @@ function formatDifference({ absolute, percentChange: relative }) {
rel = formatConfidenceInterval(negate(relative), percent);
abs = formatConfidenceInterval(negate(absolute), milli);
} else {
word = `<strong>unsure 🔍</strong>`; // bold blue
word = `<strong>unsure </strong>`; // bold blue
rel = formatConfidenceInterval(relative, (n) => colorizeSign(n, percent));
abs = formatConfidenceInterval(absolute, (n) => colorizeSign(n, milli));
}
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/multi-measure-results-running.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h4>duration</h4>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
>multi-measure-report-id: <strong>faster ✔</strong>
<em>4% - 8% (6.30ms - 13.34ms)</em><br /><sup
Expand All @@ -45,7 +45,7 @@ <h4>window.usedJSHeapSize</h4>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
>multi-measure-report-id: <strong>slower ❌</strong>
<em>91% - 91% (3.25ms - 3.26ms)</em><br /><sup
Expand All @@ -71,7 +71,7 @@ <h3>Results</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
><strong>multi-measure-report-id</strong></summary
>
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/multi-measure-running.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3>Summary</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
>multi-measure-report-id
</div>
Expand All @@ -41,7 +41,7 @@ <h3>Results</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
><strong>multi-measure-report-id</strong></summary
>
Expand Down
20 changes: 10 additions & 10 deletions tests/fixtures/multiple-entries.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>Summary</h3>
class="summary::report-id"
data-run-number="50"
>
<span class="status"></span>report-id: <strong>unsure 🔍</strong>
<span class="status"></span>report-id: <strong>unsure </strong>
<em>-10% - +12% (-4.10ms - +5.24ms)</em><br /><sup
>local-framework vs base-framework</sup
>
Expand All @@ -26,7 +26,7 @@ <h3>Summary</h3>
data-run-number="50"
>
<span class="status"></span>test-results-new-id:
<strong>unsure 🔍</strong> <em>-21% - +2% (-10.34ms - +1.15ms)</em
<strong>unsure </strong> <em>-21% - +2% (-10.34ms - +1.15ms)</em
><br /><sup>local-framework vs base-framework</sup>
</div>
</li>
Expand Down Expand Up @@ -90,7 +90,7 @@ <h3>Results</h3>
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-12% - +9%<br />-5.24ms -
<strong>unsure </strong><br />-12% - +9%<br />-5.24ms -
+4.10ms
</td>
</tr>
Expand All @@ -101,7 +101,7 @@ <h3>Results</h3>
<strong>slower ❌</strong><br />9% - 38%<br />3.55ms - 12.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-10% - +12%<br />-4.10ms -
<strong>unsure </strong><br />-10% - +12%<br />-4.10ms -
+5.24ms
</td>
<td align="center">-</td>
Expand Down Expand Up @@ -157,11 +157,11 @@ <h3>Results</h3>
18.26ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-1% - +26%<br />-0.40ms -
<strong>unsure </strong><br />-1% - +26%<br />-0.40ms -
+10.72ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-3% - +24%<br />-1.15ms -
<strong>unsure </strong><br />-3% - +24%<br />-1.15ms -
+10.34ms
</td>
</tr>
Expand All @@ -173,11 +173,11 @@ <h3>Results</h3>
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-22% - -0%<br />-10.72ms -
<strong>unsure </strong><br />-22% - -0%<br />-10.72ms -
+0.40ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-12% - +9%<br />-5.24ms -
<strong>unsure </strong><br />-12% - +9%<br />-5.24ms -
+4.10ms
</td>
</tr>
Expand All @@ -188,12 +188,12 @@ <h3>Results</h3>
<strong>slower ❌</strong><br />9% - 38%<br />3.55ms - 12.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-21% - +2%<br />-10.34ms -
<strong>unsure </strong><br />-21% - +2%<br />-10.34ms -
+1.15ms
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-10% - +12%<br />-4.10ms -
<strong>unsure </strong><br />-10% - +12%<br />-4.10ms -
+5.24ms
</td>
</tr>
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/new-comment-running.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ <h3>Summary</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
>report-id
</div>
Expand All @@ -41,7 +41,7 @@ <h3>Results</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
><strong>report-id</strong></summary
>
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/test-results-2-updated-comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>Summary</h3>
class="summary::JQx4P-VUyiFWEMlMIUU5w9uyy6s"
data-run-number="50"
>
<span class="status"></span>test_bench: <strong>unsure 🔍</strong>
<span class="status"></span>test_bench: <strong>unsure </strong>
<em>-11% - +13% (-5.10ms - +6.24ms)</em><br /><sup
>local-framework vs base-framework</sup
>
Expand Down Expand Up @@ -79,7 +79,7 @@ <h3>Results</h3>
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-13% - +10%<br />-6.24ms -
<strong>unsure </strong><br />-13% - +10%<br />-6.24ms -
+5.10ms
</td>
</tr>
Expand All @@ -91,7 +91,7 @@ <h3>Results</h3>
13.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-11% - +13%<br />-5.10ms -
<strong>unsure </strong><br />-11% - +13%<br />-5.10ms -
+6.24ms
</td>
<td align="center">-</td>
Expand Down
4 changes: 2 additions & 2 deletions tests/fixtures/test-results-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-12% - +9%<br />-5.24ms - +4.10ms
<strong>unsure </strong><br />-12% - +9%<br />-5.24ms - +4.10ms
</td>
</tr>
<tr>
Expand All @@ -53,7 +53,7 @@
<strong>slower ❌</strong><br />9% - 38%<br />3.55ms - 12.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-10% - +12%<br />-4.10ms - +5.24ms
<strong>unsure </strong><br />-10% - +12%<br />-4.10ms - +5.24ms
</td>
<td align="center">-</td>
</tr>
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/test-results-existing-comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>Summary</h3>
class="summary::report-id"
data-run-number="50"
>
<span class="status"></span>report-id: <strong>unsure 🔍</strong>
<span class="status"></span>report-id: <strong>unsure </strong>
<em>-10% - +12% (-4.10ms - +5.24ms)</em><br /><sup
>local-framework vs base-framework</sup
>
Expand Down Expand Up @@ -79,7 +79,7 @@ <h3>Results</h3>
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-12% - +9%<br />-5.24ms -
<strong>unsure </strong><br />-12% - +9%<br />-5.24ms -
+4.10ms
</td>
</tr>
Expand All @@ -90,7 +90,7 @@ <h3>Results</h3>
<strong>slower ❌</strong><br />9% - 38%<br />3.55ms - 12.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-10% - +12%<br />-4.10ms -
<strong>unsure </strong><br />-10% - +12%<br />-4.10ms -
+5.24ms
</td>
<td align="center">-</td>
Expand Down
10 changes: 5 additions & 5 deletions tests/fixtures/test-results-existing-running.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ <h3>Summary</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
>report-id: <strong>unsure 🔍</strong>
>report-id: <strong>unsure </strong>
<em>-10% - +12% (-4.10ms - +5.24ms)</em><br /><sup
>local-framework vs base-framework</sup
>
Expand All @@ -44,7 +44,7 @@ <h3>Results</h3>
href="https://github.com/andrewiggins/tachometer-reporter-action/runs/862215228"
title="Currently running in Pull Request Test #50…"
aria-label="Currently running in Pull Request Test #50…"
>
>
</a></span
><strong>report-id</strong></summary
>
Expand Down Expand Up @@ -93,7 +93,7 @@ <h3>Results</h3>
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-12% - +9%<br />-5.24ms -
<strong>unsure </strong><br />-12% - +9%<br />-5.24ms -
+4.10ms
</td>
</tr>
Expand All @@ -104,7 +104,7 @@ <h3>Results</h3>
<strong>slower ❌</strong><br />9% - 38%<br />3.55ms - 12.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-10% - +12%<br />-4.10ms -
<strong>unsure </strong><br />-10% - +12%<br />-4.10ms -
+5.24ms
</td>
<td align="center">-</td>
Expand Down
6 changes: 3 additions & 3 deletions tests/fixtures/test-results-new-comment.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h3>Summary</h3>
class="summary::JQx4P-VUyiFWEMlMIUU5w9uyy6s"
data-run-number="50"
>
<span class="status"></span>test_bench: <strong>unsure 🔍</strong>
<span class="status"></span>test_bench: <strong>unsure </strong>
<em>-10% - +12% (-4.10ms - +5.24ms)</em><br /><sup
>local-framework vs base-framework</sup
>
Expand Down Expand Up @@ -79,7 +79,7 @@ <h3>Results</h3>
</td>
<td align="center">-</td>
<td align="center">
<strong>unsure 🔍</strong><br />-12% - +9%<br />-5.24ms -
<strong>unsure </strong><br />-12% - +9%<br />-5.24ms -
+4.10ms
</td>
</tr>
Expand All @@ -90,7 +90,7 @@ <h3>Results</h3>
<strong>slower ❌</strong><br />9% - 38%<br />3.55ms - 12.77ms
</td>
<td align="center">
<strong>unsure 🔍</strong><br />-10% - +12%<br />-4.10ms -
<strong>unsure </strong><br />-10% - +12%<br />-4.10ms -
+5.24ms
</td>
<td align="center">-</td>
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/test-results-summary.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class="summary::JQx4P-VUyiFWEMlMIUU5w9uyy6s"
data-run-number="50"
>
<span class="status"></span>test_bench: <strong>unsure 🔍</strong>
<span class="status"></span>test_bench: <strong>unsure </strong>
<em>-10% - +12% (-4.10ms - +5.24ms)</em><br /><sup
>local-framework vs base-framework</sup
>
Expand Down
Loading