Skip to content

Instantly share code, notes, and snippets.

@jugglinmike
Created February 13, 2018 18:06
Show Gist options
  • Save jugglinmike/f795af1fb06cec58441e8d8fe13c6a53 to your computer and use it in GitHub Desktop.
Save jugglinmike/f795af1fb06cec58441e8d8fe13c6a53 to your computer and use it in GitHub Desktop.
Summarize WPT Dashboard report data
#!/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