Even with $ErrorActionPreference, PowerShell won't automatically fail
when an external command fails with an error code. This explicitly
checks those exit codes and throws an error when that occurs.
Hopefully prevents false successes like that shown in this AppVeyor
test run: https://goo.gl/xxRsF9.
Though it was thought to be reliable when running through 'self-test' on
Windows, it's yet to be seen how reliable.
The worst thing that could come of adding Windows testing would be that
we have test failures again after such a string of green checkmarks and
confidence.
Also, reordered.
This implements a first generation of Windows CI testing. Presently,
this only runs valuable, hand-picked tests which have been known to work
in the past, and whose failure would indicate a critical problem.
A test which isn't passing doesn't mean that the feature being tested is
not working. For example, the 'create' test fails ostentatiously,
though the 'meteor create' command certainly works in practice. This
points to problems some compatibility problems with the 'self-test'
harness itself, some of which I'm aware of. Though, it likely will
highlight some legitimate problems which Windows users experience too.
There are a number of additional tests which should be enabled which
likely pass already, and many more which are failing and we should fix.
Additional tests can be added to the scripts/windows/appveyor/test.ps1
file as they've been deemed working.
Altogether, this will take extensive work to achieve the same level of
coverage our Unix test suite enjoy, but we've got to start somewhere!
cc @benjamn
This is in an attempt to resolve a situation which could occur when the
extraction of the dev_bundle.tar fails with an EOF error, but the tool
continues as if the file was fine. Ultimately the, error preference
set in the PS1 script is only observed in the case of PowerShell
ErrorLevel and not just an error condition encountered in a command.
The SAVE_DEV_BUNDLE_TARBALL environment variable is already supported in the Unix version and this mimics that functionality in the Windows script. Use of this flag makes debugging much less painful, especially when switching branches (for example, during a `git bisect`) as the dev_bundle can be cached locally.
I also replaced a couple un-related uses of `echo` with `Write-Host` which is the preferred way to output messages in PowerShell as it supports more options.
Fixes: developer experience
Even though I think the fight is a bit futile, it is considered best practice to have newlines at the end of all files. At the request of meteor/meteor#7786, this commit adds newlines to the end of the new app skeleton `.gitignore` file. These skel files are used when generating new meteor apps so this avoids perpetuation of this problem into futrue generations. ;)
In an effort to beef up this PR, I also took the liberty of fixing the few other Meteor files which were lacking newlines (all `.gitignore` files)
Closesmeteor/meteor#7786
Turns out there was unused code that dealt with strings
that may or may not have been initialized, and treated
them as multi-byte strings even though they were unicode
strings.
I don't actually understand why this would cause a failure
only on Windows Server 2012, but this change definitely fixed
the problem, and the code removed was unnecessary and wrong anyways.
While at it, improved error reporting in case we fail to
get the link to the bootstrap tarball, or download it.
Also fixed a bug that broke login/signup (due to passing a
char* instead of a wchar_t*)
Uses the https://packages.meteor.com/bootstrap-link
URL to generate a link to the windows bootstrap tarball.
With this change we no longer have to build a new installer
for every release.
This API actually lets us download the bootstrap tarball from cloudfront
on Windows Server, /and/ correctly reads the proxy settings from Internet
Explorer.
This is a step on the way to building an installer that always
fetches the latest release of Meteor, so that we don't need to
build a new installer for every release.
TODO:
* Expose a new endpoint on https://package.meteor.com with the latest
release, and consume it in the installer
* Use libcurl to fetch the installer, so that we can bypass the TLS
settings on Windows Server which by default don't let you fetch
HTTPS assets that use TLS 1.2 (as do ours)
* Automatically detect and use the proxy settings configured in
Internet Explorer, eg
http://stackoverflow.com/questions/202547/how-do-i-find-out-the-browsers-proxy-settings
This duplicates logic we had for Mac/Linux that lets you
set a USE_TEST_DEV_BUNDLE_SERVER environment variable
to try running a newly built dev bundle before publishing
it.