1. Don't use PointerEvents for tests in Firefox, see #6539. This makes
all tests but one pass.
2. Run built files against FirefhoxHeadless. This means we run unminified
on Chrome and minified on Firefox. This helps keep the build time down
by not running everything twice on both browsers, but will still catch
Firefox-specific bugs that we can then run locally.
Since Chrome added an officially supported headless mode, there's no
reason to use Electron for our unit tests. This will be both more accurate
(uses actual Chrome) and also gets rid of the rather large Electron
dependency.
WebGL is disabled in headless, so we only use headless on CI (because we
also disable webGL tests there). When running locally, it just shows an
actual Chrome window. Chrome has an issue and plans to address this:
https://bugs.chromium.org/p/chromium/issues/detail?id=765284
1. Start building on travis with Node 8 since it will be LTS soon (it
should slightly speed up builds as well)
2. Add package-lock.json to .gitignore, this is a new npm-generated file
that we won't be submitting to GitHub (it changes almost every time you run
`npm install`).
3. Add package.json to .gitattributes to fix line endings caused by this
npm bug: https://github.com/npm/npm/issues/17161
The problem was that travis itself was killing our build process because
we were trying to run 8 requirejs processes at once, leading us to run out
of memory (only 3GB available on travis). This adds a command line to
specify concurrency and updates travis to do at most 2 (one for each core).
1. Caching makes eslint only take ~3 seconds plus any files that have
changed since the last time you ran it. Since it's unlikely devs are
touching every tile between runs, this makes eslint much incredibly faster
in the average case. Also added the genereated `.eslintcache` to git
ignore.
2. Switched to the pure cli version of eslint and remove `eslint-watch`,
which I'm pretty sure no one uses anyway. This simplified our usage and
means we lint all js and html files by default except for the globs
specifically listed in `.eslintignore` This also shaves 2-4 seconds off
startup time because we're not loading gulpfile.js anymore.
3. Fixed an issue in `index.release.html`, which was previously not linted.
This change allows travis to deploy the generate zip files and
npm packages in addition to the build output. Each package
gets a unique name based on branch name and build number.
Also updated deployment step not to delete these packages so that
they can be depended on until the branch is merged.
The travis command was missing `--` which was causing it to not fail
in the event of an error. This also means we let a couple of warnings
slip into master (which I have also fixed).
1. Running travis under node 4.3.x gives a decent improvement over 0.12.
2. Move `cloc` to the end of the build since it's the least important.
3. Take advantage of multiple cores for combine/minification
Number 3 reduced `makeZipFile` times on my machine from 5:40 to 2:30,
performance increases has transferred to travis as well. Because
travis reports 32 cores and trying to use them all results in
travis killing the build, I put in a hardcoded limit of 8 for now.
My approach is a little hacky (I exec a seprate gulp task passing a base64
encoded string on the command line), but I couldn't determine a better
way to handle it with gulp because there's no programmatic way to spawn
a task (I think this is being fixed in gulp 4, so we'll revisit when that
comes out).
1. Run non-webgl tests as part of travis using Electron. They run in both
module and release form.
2. Run cloc as part of the build process
3. jsHint no longer fails the gulp task when you run `npm run jsHint`,
since that behavior was really annoying. It still fails under travis or
when passed the `--failTaskOnError` option.
4. Improve log output by using travis folding commands. Each part of the
build is now collapsed into its own section.
5. Added `--suppressPassed` option to avoid showing passed tests in output.
Our travis log got too big and travis refused to show it (even with the
folding) unless you looked at raw test.
Apparently #3430 is still an issue and the travis_wait command added as
part of #3432 does not work as advertised. To address the issue once and
for all, I turned up the loglevel on requirejs so that it always outputs
progress to the build log (this was actually requested by @shunter and
a few others after the logging went away when we moved to gulp anyway).
Long story short we should finally stop seeing travis timeouts.
I also make jsHint run as a separate step and instead of `release` we
run `makeZipFile` to be sure the entire build process works. If
`makeZipFile` were to error, the previous configuration wouldn't have
caught it.
So it turns out that jsHint no longer works on Node 0.10.x, which is
ancient anyway. So I updated Travis to use 0.12.x. I then decided to
update our .jshintrc to take advantage of the latest JSHint features and
that produced a TON of new (perfectly valid) errors about unused variables,
empty code blocks, and unused defined globals, which I have now cleaned up.
This also uncovered a bunch of other stuff that I also fixed.
In summary:
1. Update travis to use Node 0.12.x
2. Update .jshintrc to take advantage of new features
3. Fix bad code pointed out by said features
4. Remove all uneeded `jasmine` globals in spec files
5. Generate a `Specs` specific .jshintrc as part of the build which enables jasmine mode in jshint
6. Move `QuadtreePrimitive` to Development Sandcastle gallery.
7. Update NPM modules to latest versions.
8. Lock NPM modules to specific versions to avoid untested updates in the future.
9. Ran `sortRequires`
1. Move all build related code to gulpfile.js
2. Add `npm` scripts for all gulp tasks so no one needs to install gulp globally.
3. Added new `jshint-watch` task for continually running jsHint on changed files and writing the results to the console.