Created
February 13, 2018 18:06
-
-
Save jugglinmike/f795af1fb06cec58441e8d8fe13c6a53 to your computer and use it in GitHub Desktop.
Summarize WPT Dashboard report data
This file contains hidden or 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
#!/bin/bash | |
set -e | |
here=$(dirname $(readlink -f $0)) | |
function count { | |
cat <<HERE | python | |
import json | |
with open('$1') as handle: | |
print len(json.loads(handle.read()).keys()) | |
HERE | |
} | |
function calculate { | |
sha=$1 | |
platform=$2 | |
filename=${platform}-summary.json | |
url="https://storage.googleapis.com/wptd/$sha/$filename.gz" | |
wget --quiet $url | |
mv $filename.gz $filename | |
actual=$(count $filename) | |
cd $here/../web-platform-tests | |
git checkout --quiet $sha > /dev/null | |
commit_date=$(git show --format='%ci' --no-patch) | |
expected=$(./wpt run --list-tests firefox | wc -l) | |
pct=$(python -c "print $actual./$expected*100") | |
echo "- $platform @ $sha - $commit_date" | |
echo " Actual: $actual" | |
echo " Expected: $expected" | |
echo " $pct%" | |
} | |
calculate 7a4c0d6617 edge-15-windows-10-sauce | |
calculate fade9e6a04 chrome-63.0-linux | |
calculate 9d90463821 firefox-57.0-linux | |
calculate 1f2505669c safari-11.0-macos-10.12-sauce |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment