-
Notifications
You must be signed in to change notification settings - Fork 237
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
Benchmark Runner results shown in viewer #390
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f77bbf9
Benchmark Result Summary Introduced
jakethekoenig 387a8eb
Benchmark result summary created
jakethekoenig 1ea2b20
Use exercism viewer with benchmark runner - WIP
jakethekoenig b3f98d8
Benchmark runner info but in display
jakethekoenig 4194c40
Similar tests grouped
jakethekoenig dda54ba
diff staged
jakethekoenig a5ab155
Ratio instead of percent
jakethekoenig 2fa836a
Fix comparison formatting
jakethekoenig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{% from 'transcript.jinja' import transcript_container %} | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Benchmark Results</title> | ||
<style> | ||
{% include 'css/benchmark.css' %} | ||
{% include 'css/transcript.css' %} | ||
</style> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css"> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js"></script> | ||
<script>hljs.initHighlightingOnLoad();</script> | ||
<script> | ||
document.addEventListener("DOMContentLoaded", function() { | ||
function updateVisibility() { | ||
const hash = window.location.hash.substring(1); | ||
const resultSections = document.querySelectorAll('.result-section'); | ||
resultSections.forEach(section => { | ||
if (section.id === hash || hash === '') { | ||
section.style.display = 'block'; | ||
} else { | ||
section.style.display = 'none'; | ||
} | ||
}); | ||
} | ||
|
||
window.addEventListener('hashchange', updateVisibility); | ||
}); | ||
</script> | ||
<script> | ||
function toggleVisibility(family) { | ||
const familyButtons = document.querySelectorAll('.' + family + '-child'); | ||
familyButtons.forEach(button => { | ||
button.classList.toggle('hidden'); | ||
}); | ||
} | ||
</script> | ||
<script> | ||
{% include 'js/transcript.js' %} | ||
</script> | ||
</head> | ||
<body> | ||
<div id="header"> | ||
{% for field, data in summary.formatted_summary().items() %} | ||
<p>{{ field|capitalize }}: {{ data }}</p> | ||
{% endfor %} | ||
</div> | ||
<div id="container"> | ||
<div id="selector"> | ||
{% for family, results in summary.result_groups.items() %} | ||
{% if results|length == 1 %} | ||
<button class="{{ results[0].display_color() }}" onclick="window.location.hash='{{ results[0].name }}'">{{ results[0].name }}</button> | ||
{% else %} | ||
<button class="{{ results[0].display_color() }}" onclick="toggleVisibility('{{family}}')">{{family}}</button> | ||
{% for result in results %} | ||
<button class="hidden {{ family }}-child family-child {{ result.display_color() }}" onclick="window.location.hash='{{ result.name }}'">{{ result.name }}</button> | ||
{% endfor %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
<div id="viewer"> | ||
{% for test, formatted_result in summary.formatted_results().items() %} | ||
<div id="{{ test }}" class="result-section"> | ||
{% for display_name, section in formatted_result.items() %} | ||
<h1>{{ display_name|capitalize }}</h1> | ||
<div class="content"> | ||
{% if section.type == "text" %} | ||
{{ section.content }} | ||
{% elif section.type == "code" %} | ||
<pre><code>{{ section.content }}</code></pre> | ||
{% elif section.type == "json" %} | ||
<pre>{{ section.content |tojson(indent=4)|safe}}</pre> | ||
{% elif section.type == "transcript" %} | ||
{{ transcript_container(section.content) }} | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is making booleans bold/green and strings and numbers red. I like having colors but I mistook this for indicating failure/success. Could it be different colors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that does sort of seem bad in the json code blocks where true mostly means error detected. I'll check. If it's hard I'll just turn off syntax highlighting for json since it doesn't add much anyway