macOS Gatekeeper adds a flag ("-psn_0_[six or seven digits here]") when it intercepts Atom launches.
This happens for fresh downloads, new installs, or first launches after upgrading).
We don't need this flag, and yargs interprets it as many short flags. So, we filter it out.
Before, in order to retrieve the application name, Electron's
`getName()` method was used (https://electronjs.org/docs/api/app#appgetname).
Now, instead, we also use the Atom version in order to calculate the release
channel and be able to have it on the app name (e.g `Atom Nightly`).
On Azure and Travis, we recently started observing a few test failures
in atom-application.test.js.
After staring at those tests for a bit, it doesn't seem like they are
failing due to a race condition. Instead, it is possible that these
tests are simply timing out due to CI containers sometimes being
overloaded and, thus, slower. I tested this hypothesis locally by
running tests on a VM while stress-testing the host machine. Tests would
eventually have passed, but they timed out before having the chance to
do so.
This commit increases the timeout on CI to 10 seconds for
`AtomApplication` tests in an attempt to fix the spurious failures we
were observing. This is similar to what we've historically done for
renderer process tests (see
7faea50190/spec/spec-helper.coffee (L50)).
In these tests, we create a temporary `ATOM_HOME` to avoid cluttering
the user's real `~/.atom` folder.
Adding a symlink to the real `compile-cache` was introduced to speed up
main process tests, so that the transpilation cache could be reused.
Unfortunately, when the real `~/.atom` folder did not exist (such as on
a pristine environment on CI), it would confuse Atom, which would think
that it didn't need to re-create a `compile-cache` folder again, but
wouldn't be able to write to it because the symlink pointed to a
non-existant directory.
Main process tests were overhauled and made faster recently, so we can
safely remove this performance optimization.