diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | scripts/create_result_table.js | 42 | ||||
-rwxr-xr-x | scripts/deploy_results.sh | 11 |
3 files changed, 48 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore index 7c565ffc13..8e63281caf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ /src/shader/shaders_gl.cpp /src/shader/shaders_gles2.cpp /bin/style.bin.js +/test/fixtures/styles/index.html diff --git a/scripts/create_result_table.js b/scripts/create_result_table.js new file mode 100644 index 0000000000..ad604890f7 --- /dev/null +++ b/scripts/create_result_table.js @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +var fs = require('fs'); +var path = require('path'); + +var html = + '<style>body { font-family: Helvetica; }</style>\n' + + '<table>\n' + + '<tr>\n' + + ' <th>Actual</th>\n' + + ' <th>Expected</th>\n' + + ' <th>Info</th>\n' + + '</tr>\n'; + +var dir = fs.readdirSync('./test/fixtures/styles').filter(function(name) { + return name.match(/\.info\.json$/); +}).forEach(function(name) { + var info = require(path.join(path.resolve('.'), './test/fixtures/styles', name)); + var base = path.basename(name, '.info.json'); + + html += + '<tr>\n' + + ' <td><img src="' + base + '.actual.png"></td>\n' + + ' <td><img src="https://raw.githubusercontent.com/mapbox/mapbox-gl-native/' + process.env.TRAVIS_COMMIT + '/test/fixtures/styles/' + base + '.expected.png"></td>\n' + + ' <td>\n' + + ' <h2 style="text-align:center"><a href="https://raw.githubusercontent.com/mapbox/mapbox-gl-native/' + process.env.TRAVIS_COMMIT + '/test/fixtures/styles/' + base + '.style.json">' + base + '</a></h2>\n' + + ' <ul>\n' + + ' <li>zoom: <strong>' + (info.zoom || 0) + '</strong></li>\n' + + ' <li>latitude: <strong>' + (info.latitude || 0) + '</strong></li>\n' + + ' <li>longitude: <strong>' + (info.longitude || 0) + '</strong></li>\n' + + ' <li>angle: <strong>' + (info.angle || 0) + '</strong></li>\n' + + ' <li>width: <strong>' + (info.width || 0) + '</strong></li>\n' + + ' <li>height: <strong>' + (info.height || 0) + '</strong></li>\n' + + ' </ul>\n' + + ' </td>\n' + + '</tr>\n' + ; +}); + +html += "</table\n"; + +fs.writeFileSync('./test/fixtures/styles/index.html', html); diff --git a/scripts/deploy_results.sh b/scripts/deploy_results.sh index 9877f99843..d796ea2270 100755 --- a/scripts/deploy_results.sh +++ b/scripts/deploy_results.sh @@ -3,10 +3,9 @@ set -e set -o pipefail -aws s3 cp test/fixtures/styles/ s3://mapbox-gl-testing/headless/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/ --acl public-read --recursive --exclude "*" --include "*.png" +node scripts/ -cd test/fixtures/styles -for FILE in *.png ; do - echo http://mapbox-gl-testing.s3.amazonaws.com/headless/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/$FILE -done -cd ../../.. +aws s3 cp test/fixtures/styles/ s3://mapbox-gl-testing/headless/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/ --acl public-read --recursive --exclude "*" --include "*.actual.png" --include "*.html" + + +echo http://mapbox-gl-testing.s3.amazonaws.com/headless/$TRAVIS_BUILD_NUMBER/$TRAVIS_JOB_NUMBER/index.html |