Fix reporting code coverage.
The coverage uploaded by the npm codecov module sometimes fails without
any error messge.  This switches to the bash codecov program.
Also, on CI failures, include the date in the baseline images name.
This makes it easier to track changes.
MODIFY
.travis.yml
.travis.yml
@@ -74,11 +74,13 @@ after_failure:
# Generate a new set of baseline images, in case we decide the new results
# are now correct
- rm -r dist/data/base-images 2>/dev/null >/dev/null || true
- - python tests/runners/baseline_images.py -gvb _build
- - python scripts/upload_travis_results.py _build/base-images.tgz
+ - python tests/runners/baseline_images.py -cgvb _build
+ - find _build -name 'Baseline Images*.tgz' -exec python scripts/upload_travis_results.py {} \+ || true
after_success:
- - npm run codecov
+ # - find dist \( -name '*coverage*xml' -o -name 'lcov.info' \) -exec ls -al {} \+ || true
+ # - npm run codecov
+ - bash <(curl -s https://codecov.io/bash)
# Upload build artifacts
- pip install --user --upgrade girder-client requests[security] pyOpenSSL six
- find dist/built -type f -exec python scripts/upload_travis_results.py {} \+

MODIFY
package-lock.json
package-lock.json
"integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=",
"dev": true
},
- "agent-base": {
- "version": "4.3.0",
- "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz",
- "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==",
- "dev": true,
- "requires": {
- "es6-promisify": "^5.0.0"
- }
- },
"ajv": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.1.tgz",
"sprintf-js": "~1.0.2"
}
},
- "argv": {
- "version": "0.0.2",
- "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz",
- "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=",
- "dev": true
- },
"arr-diff": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz",
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true
},
- "codecov": {
- "version": "3.5.0",
- "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.5.0.tgz",
- "integrity": "sha512-/OsWOfIHaQIr7aeZ4pY0UC1PZT6kimoKFOFYFNb6wxo3iw12nRrh+mNGH72rnXxNsq6SGfesVPizm/6Q3XqcFQ==",
- "dev": true,
- "requires": {
- "argv": "^0.0.2",
- "ignore-walk": "^3.0.1",
- "js-yaml": "^3.13.1",
- "teeny-request": "^3.11.3",
- "urlgrey": "^0.4.4"
- }
- },
"codemirror": {
"version": "5.48.0",
"resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.48.0.tgz",
"integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=",
"optional": true
},
- "es6-promisify": {
- "version": "5.0.0",
- "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz",
- "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=",
- "dev": true,
- "requires": {
- "es6-promise": "^4.0.3"
- },
- "dependencies": {
- "es6-promise": {
- "version": "4.2.8",
- "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz",
- "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==",
- "dev": true
- }
- }
- },
"es6-set": {
"version": "0.1.5",
"resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.5.tgz",
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"aproba": {
"version": "1.2.0",
"balanced-match": {
"version": "1.0.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
"code-point-at": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"core-util-is": {
"version": "1.0.2",
"inherits": {
"version": "2.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"ini": {
"version": "1.3.5",
"version": "1.0.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"number-is-nan": "^1.0.0"
}
"version": "3.0.4",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
"minimist": {
"version": "0.0.8",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"safe-buffer": "^5.1.2",
"yallist": "^3.0.0"
"version": "0.5.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"minimist": "0.0.8"
}
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"object-assign": {
"version": "4.1.1",
"version": "1.4.0",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"wrappy": "1"
}
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"safer-buffer": {
"version": "2.1.2",
"version": "1.0.2",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0",
"version": "3.0.1",
"bundled": true,
"dev": true,
+ "optional": true,
"requires": {
"ansi-regex": "^2.0.0"
}
"wrappy": {
"version": "1.0.2",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
- "dev": true
+ "dev": true,
+ "optional": true
}
}
},
"integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=",
"dev": true
},
- "https-proxy-agent": {
- "version": "2.2.2",
- "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.2.tgz",
- "integrity": "sha512-c8Ndjc9Bkpfx/vCJueCPy0jlP4ccCCSNDp8xwCZzPjKJUm+B+u9WX2x98Qx4n1PiMNTWo3D7KK5ifNV/yJyRzg==",
- "dev": true,
- "requires": {
- "agent-base": "^4.3.0",
- "debug": "^3.1.0"
- },
- "dependencies": {
- "debug": {
- "version": "3.2.6",
- "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz",
- "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==",
- "dev": true,
- "requires": {
- "ms": "^2.1.1"
- }
- },
- "ms": {
- "version": "2.1.2",
- "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
- "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
- "dev": true
- }
- }
- },
"i": {
"version": "0.3.6",
"resolved": "https://registry.npmjs.org/i/-/i-0.3.6.tgz",
"integrity": "sha1-VfuN62mQcHB/tn+RpGDwRIKUx30=",
"dev": true
},
- "node-fetch": {
- "version": "2.6.0",
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
- "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==",
- "dev": true
- },
"node-libs-browser": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.2.1.tgz",
}
}
},
- "teeny-request": {
- "version": "3.11.3",
- "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz",
- "integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==",
- "dev": true,
- "requires": {
- "https-proxy-agent": "^2.2.1",
- "node-fetch": "^2.2.0",
- "uuid": "^3.3.2"
- }
- },
"temp": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz",
"integrity": "sha1-FQWgOiiaSMvXpDTvuu7FBV9WM6k=",
"dev": true
},
- "urlgrey": {
- "version": "0.4.4",
- "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz",
- "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=",
- "dev": true
- },
"use": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",

MODIFY
package.json
package.json
"bootstrap": "^3.3.6",
"bootswatch": "^3.3.6",
"bowser": "^1.4.6",
- "codecov": "^3.1.0",
"codemirror": "^5.41.0",
"colorbrewer": "^1.0.0",
"css-loader": "^0.28.11",
"tutorialsci-all": "GEOJS_TEST_CASE=tests/tutorials.js karma start karma-cov.conf.js --single-run --browsers ChromeHeadlessTouch,FirefoxHeadlessTouch,PhantomJS",
"test-webgl": "GEOJS_TEST_CASE=tests/test-gl.js karma start karma-cov.conf.js --single-run --browsers ChromeHeadlessTouch",
"test-headed": "GEOJS_TEST_CASE=tests/test-headed.js xvfb-run -s '-ac -screen 0 1280x1024x24' karma start karma-cov.conf.js --single-run --browsers ChromeFull",
- "codecov": "codecov",
"combine-coverage": "istanbul-combine -d dist/cobertura -r cobertura 'dist/coverage/json/**/coverage-final.json'",
"examples": "node examples/build.js && webpack --config webpack-examples.config.js && node tutorials/build.js && webpack --config webpack-tutorials.config.js && node ./tests/runners/server.js --host \"${HOST-}\" --port ${PORT-8082} --dist",
"start-test": "node examples/build.js; forever start ./tests/runners/server.js",

MODIFY
tests/runners/baseline_images.py
tests/runners/baseline_images.py
import argparse
import girder_client
import os
+import shutil
import subprocess
import time
@@ -45,6 +46,13 @@ def generate_baselines(args):
tarSize = os.path.getsize(tarPath)
if args['verbose'] >= 1:
print('Created baseline image tgz file, %d bytes' % tarSize)
+ if args.get('copy'):
+ name = 'Baseline Images %s.tgz' % time.strftime(
+ '%Y-%m-%d %H:%M:%S', time.localtime(os.path.getmtime(tarPath)))
+ copiedTarPath = os.path.join(buildPath, name)
+ shutil.copy2(tarPath, copiedTarPath)
+ if args['verbose'] >= 1:
+ print('Copied baseline image tgz file to %s' % copiedTarPath)
def upload_baselines(args):
@@ -82,7 +90,7 @@ def upload_baselines(args):
print('Upload to file %s' % uploadedFile['_id'])
testDataPath = os.path.abspath('tests/external-data')
if not os.path.isdir(testDataPath):
- raise Exception('Can\'t update test-data information.')
+ raise Exception('Cannot update test-data information.')
sha512 = gc.getFile(uploadedFile['_id'])['sha512']
open(os.path.join(testDataPath, 'base-images.tgz.sha512'), 'w').write(sha512)
if args['verbose'] >= 1:
@@ -100,24 +108,28 @@ if __name__ == '__main__':
'images. Only applies if the images are generated.')
parser.add_argument(
'--no-xvfb', dest='xvfb', action='store_false',
- help='Don\'t use xvfb-run when generating baseline images.')
+ help='Do not use xvfb-run when generating baseline images.')
parser.add_argument(
'--generate', '-g', dest='make', action='store_true',
help='Generate baseline images by running "ctest -C baseline_images '
'-R baseline_images".')
parser.add_argument(
'--no-generate', dest='make', action='store_false',
- help='Don\'t generate baseline images.')
+ help='Do not generate baseline images.')
parser.add_argument(
'--build', '-b', default='.',
help='The build directory. This is created if baseline images are '
'generated and the directory does not exist.')
+ parser.add_argument(
+ '--copy', '-c', dest='copy', action='store_true',
+ help='Copy base-images.tgz to a file that includes the date in its '
+ 'name (Baseline Images <date>.tgz).')
parser.add_argument(
'--upload', '-u', dest='upload', action='store_true',
help='Upload base-images.tgz.')
parser.add_argument(
'--no-upload', dest='upload', action='store_false',
- help='Don\'t upload the baseline image tarball.')
+ help='Do not upload the baseline image tarball.')
parser.add_argument(
'--dest', '-d', default='https://data.kitware.com',
help='Destination for upload. Must be a Girder server. /api/v1 is '

Fix reporting code coverage.

The coverage uploaded by the npm codecov module sometimes fails without
any error messge.  This switches to the bash codecov program.

Also, on CI failures, include the date in the baseline images name.
This makes it easier to track changes.