Commit Graph

41 Commits

Author SHA1 Message Date
David Glasser
94683896b7 Don't ignore nonexistent settings file in run
Refactorings in 1.0.2 accidentally started ignoring errors related to
--settings.  Fixes #3757.
2015-02-17 16:36:39 -08:00
Avital Oliver
e866f7ca8c Tag known failing Windows self-tests
This way we can start running `meteor self-test` for regression testing,
while in parallel addressing the failures that are tagged by this commit.
2015-02-10 13:33:14 -08:00
Avital Oliver
15e87e33e8 Fix tests hard-coding METEOR as release track
Now it reads the value from catalog.DEFAULT_TRACK, which is both more
correct and necessary for the current "preview" state of Windows.

Fixed the following self-tests on Windows:
- run: update during run
- releases: springboard

Unfortunately, the autoupdate self-test still fails, maybe due to a real
bug?
2015-02-10 11:21:17 -08:00
Avital Oliver
8fb583507f Make "run" selftest pass on Windows 2015-02-06 13:47:15 -08:00
David Glasser
096df9d62d Refactor parent pid check; drop --keepalive
This commit moves parent pid process from the webapp package to the boot
script. This means that daemonized apps without webapp will also exit
when the runner exits, if run from the runner. (For example, several
self-tests such as 'autoupdate' no longer leak node processes.) This is
controlled via the $METEOR_PARENT_PID environment variable instead of
from command line arguments, in order to make fewer assumptions about
how Meteor apps process arguments.

This also drops the old --keepalive support (which already has stopped
being used by the dev mode runner or any MDG deployment platforms).
Neither --parent-pid nor --keepalive were documented beforehand, and
--keepalive was already deprecated before 1.0.

These flags used to also incidentally trigger printing the LISTENING
line; this is now controlled by $METEOR_PRINT_ON_LISTEN.

Fixes #3315.
2015-01-05 15:48:32 -08:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
1e5b7437a5 Refresh catalog only on relevant errors
Fixes #2846.  Fixes #2847. Fixes #2979.

Errors in the build process that could be fixed by refreshing the
catalog now cause the catalog to refresh, assuming we have not already
refreshed it recently and that we are not offline.

These commands now don't need to refresh at startup: remove, run, debug,
create, build, bundle, deploy, test-packages, rebuild, and self-test

It should be OK for create to throw SpringboardToLatestRelease even
without refreshing, since release.latestKnown is still something we know
about.
2014-12-10 19:03:05 -08:00
David Glasser
21a34a98b3 Show mongod exit message if it started up OK
Fixes "run with mongo crash" test
2014-12-09 19:52:03 -08:00
David Glasser
118e330cba fix deadlock in mongod startup failure
AppRunner.stop needs to be able to cause any Future which the AppRunner
is waiting on to return, so that it can get back to the top level of its
loop and return. (This is because for some reason it is important that
AppRunner.stop does not return until the app is guaranteed to be
stopped.)  This had not been the place for the injected "wait for mongo
to start up before running the AppProcess" future.

This also means we can't use f.future() any more, because that code
assumes that it is the only code allowed to resolve its future (it
unconditionally resolves the future when the wrapped function returns,
which is an error if it is already resolved).

This is tested by 'run errors' which was failing.  Also, the test should
only expect 2 unexpected exit code messages, not 3, since we don't print
the message the first time which didn't have a kill before it.
2014-12-09 19:38:09 -08:00
David Glasser
c49a441d3d self-test: prepare apps after createApp
This means that the first command won't need to do a big build (and
print lots of package changed notifications). Similar to what 'meteor
create' does.

Also add --prepare-app command.
2014-12-01 14:43:15 -08:00
David Glasser
3b7459e62a start on self-test. file 'run' passes 2014-11-25 09:06:27 -08:00
Emily Stark
876d222f11 Fix 'update during run' test 2014-10-23 16:56:05 -07:00
David Glasser
0fb62f1686 make 'run' test pass 2014-10-23 10:51:20 -07:00
David Glasser
9d1adbc4f3 improve 'run: run' test 2014-10-23 10:51:20 -07:00
Emily Stark
bb29469856 Replace runtime config regression selftest with simpler unit test 2014-10-08 14:28:24 -07:00
Emily Stark
aaa9bfb048 Add regression test for edbf05db 2014-10-08 14:05:02 -07:00
Emily Stark
3069788e01 Rework --mobile-server defaults.
* --port now requires a port ('meteor run --port example.com' isn't valid).
* --mobile-server defaults to your detected IP address and the port from
    --port.
* If you provide a value for --mobile-server, we default to http:// as
  the protocol. A host is required for --mobile-server if you don't omit
  the option entirely. Similar for the --server argument to 'meteor
  build'.

This commit includes the 'netroute' npm module as a core package (which
has binary dependencies) for IP detection. It would be nice to put it in
packages/non-core, but I think it has to be a core package in order to
uniload it.
2014-10-03 12:11:44 -07:00
Emily Stark
6041122944 Exit immediately if --parent-pid doesn't look like an integer.
If you pass "--parent-pid foobar", then we immediately log an error
message and exit. This check happens via `parseInt` rather than testing
for exceptions in `process.kill(parentPid, 0)` because `process.kill`
converts its pid argument to an integer, so `process.kill('foobar', 0)`
returns true just as `process.kill(0, 0)` does.
2014-09-26 14:01:19 -07:00
Emily Stark
2f47a81395 Comments from nim, ben 2014-09-25 15:30:17 -07:00
Emily Stark
4b739b0684 Add test for runner process being SIGKILLed. 2014-09-25 15:30:17 -07:00
Justin SB
cfefbcf28f Revert 7282c0ee5b, now that 0ac1855166 has reverted bdcf0d188 2014-09-19 19:10:37 -07:00
David Glasser
7282c0ee5b Fix test (broken by bdcf0d188 at least on my mac) 2014-09-08 21:28:41 -07:00
David Glasser
08b2625082 METEOR-CORE -> METEOR 2014-08-24 18:46:37 -07:00
David Glasser
94aab913f1 self-test now passes 2014-06-26 17:32:17 -07:00
Emily Stark
382be78710 'update during run' passes.
It looks like tools trees now always have a dev_bundle/ directory
instead of bin/, include/ etc. at the top level. Someone correct me if
I'm wrong.
2014-06-25 17:33:55 -07:00
Emily Stark
7336bf901b bump some self-test timeouts 2014-06-16 18:15:38 -07:00
David Glasser
498e572230 Make self-test less flaky with more waits. 2014-04-07 20:09:30 -07:00
David Glasser
3405644027 Fix runner.stop() while waiting for file change
Before this, if the runner decided to stop (eg, because mongod is
crashing too much) while waiting for file change, it would crash due to
an attempt to wait within a fiber.  Fixing that bug by adding an inFiber
would then lead to the process just not exiting, because nothing stops
the wait-specific future.
2014-04-02 21:16:59 -07:00
David Glasser
d287d36bac Make run tests less flaky 2014-03-31 20:03:01 -07:00
Emily Stark
e981b0c629 Bump run test timeouts 2014-02-26 14:26:13 -08:00
Emily Stark
222ac4ca65 Bump more self-test timeouts 2014-02-21 10:22:03 -08:00
Emily Stark
9669bbe368 Bump some run test timeouts 2014-02-20 17:25:14 -08:00
Emily Stark
b04aa12d39 Make 'empty' a test app with no packages.
Rename previous 'empty' app to 'standard-app'.
2014-02-14 17:59:59 -08:00
David Glasser
4ce13da406 Fixes to new 'run' test
- can't set env var mid-process
- need to control fake mongo, and wait
2014-02-13 18:48:19 -08:00
Geoff Schmidt
84e1d5f7cd Add a basic runner test. 2014-02-13 18:48:19 -08:00
David Glasser
1588ed51c4 remove console.log from 'meteor run --program x' 2014-02-11 01:17:52 -08:00
David Glasser
58a27d123c Fix and test some runner error handling issues
- Exit with failure if proxy starts to listen. Previously, we got stuck
  inside ProxyRunner.start(), and since we weren't waiting on any IO
  we'd exit 0!  (The existence of a yielded fiber is not sufficient to
  block Node exit.)

- Don't print various bits of startup text if we are stopped midway.

- Stop main Runner immediately if proxy or mongo runners invoke
  onFailure, rather than waiting for wait to be called and return.

- Ensure that a few Futures don't get return called on them multiple
  times.

- Ensure we don't try to call close() on the proxy's TCP server if it
  failed to listen in the first place.
2014-02-11 00:17:22 -08:00
David Glasser
9e9de95cd5 hopefully fix run --once test on release 2014-02-06 13:27:19 -08:00
David Glasser
7c02e4a59d utils.sleep -> utils.sleepMs
multiply one by a thousand
2014-02-04 17:46:19 -08:00
Geoff Schmidt
e1994f6ece First installment of 'meteor run' tests.
Tests meteor --once and restarting on upgrade.
2014-01-29 02:02:17 -08:00
Geoff Schmidt
377d940ba0 fake-mongod, a stub mongod for automated testing 2014-01-28 19:36:04 -08:00