Commit Graph

172 Commits

Author SHA1 Message Date
Sashko Stubailo
67529cee6b Use correct args 2015-01-20 22:04:23 -08:00
Sashko Stubailo
63c98725b8 Use cross-spawn 2015-01-20 22:04:23 -08:00
Sashko Stubailo
c62a37c6b5 Replace process.env.HOME with files.getHomeDir()
Conflicts:
	tools/commands-cordova.js
	tools/config.js
	tools/files.js
	tools/selftest.js
	tools/warehouse.js
2015-01-20 22:03:22 -08:00
Sashko Stubailo
7f9c8474f5 Factor out symlinking to meteor tool in selftest and tropohouse 2015-01-20 22:03:21 -08:00
Sashko Stubailo
6a534d7da1 Factor out the symlink dance into _saveIsopack 2015-01-20 22:03:21 -08:00
ekatek
b5628f4b23 minor test fixes
This mostly fixes tests:
- removes the 'restarted' check from some tests. We don't need it in those cases
  (printing the other banner is enough). We can no longer rely on that executing
  after the code in the package (in fact it seems to execute before, and then
  get overwritten), and the test still tests what it is intended to (that the new
  package code executes).

- minor fixes to essentially syntax errors -- the skeleton now uses double quotes
  instead of single quotes, so a regex failed to work, for example. We changed a
  version number in one part of the test, but not another.

- fixes selftest.js, sort of, to actually print out what test we are testing. This
  is an unfortunate interaction of Console.js changes in 1.0.2 and a progress bar
  (that came later). The progress bar erases the message telling you what test is
  running when you use a standard terminal. That's awkward, fixed.
2015-01-16 16:50:51 -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
David Glasser
6320acabc4 Merge branch 'master' into devel
Conflicts:
	History.md
	tools/safe-pathwatcher.js
	tools/tests/old.js
	tools/watch.js
2014-12-19 11:42:50 -08:00
David Glasser
d58bb59e48 Fix self-test --list formatting 2014-12-18 10:11:44 -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
809b2b69f5 Don't compile web.cordova unibuilds unless needed
Specifically, we only compile them if there's a cordova platform in the
current project, or if we are publishing the package.

(Ideally, we wouldn't require every published package to have
web.browser and web.cordova unibuilds --- we'd just publish a 'web'
unibuild unless there's actually a difference between the two. But we
are not there yet.)

This adds an extra flag to isopack-buildinfo.json, so that we know to
rebuild all the isopacks when we add the first cordova platform (or
remove the last cordova platform).

The implementation around publish is a little clunky; if you're in a
non-Cordova app and run meteor publish, it will rebuild all the packages
with web.cordova, and the next time you prepare the app it will rebuild
them again without it. It does work though.

Fixes #3274.
2014-12-11 22:26:29 -08:00
David Glasser
bc53d5f1e4 Use case in buildmessage titles consistently
Job names should not be capitalized (so they look OK in "While xxx"
messages), and are capitalized by the progress bar.

Fixes #3003.
2014-12-11 14:40:16 -08:00
David Glasser
d7d51f9dac All downloads use downloadPackagesMissingFromMap
We now can make PackageMaps without a localCatalog, for cases like this
where we really want everything in the map to be downloaded.
2014-12-10 14:42:18 -08:00
ekatek
8bf5db2de0 eliminate legacy stdout.write and stderr.write functions from Console
Now that we no longer have an automatic newline on printing, we don't have to support
the awkward legacy functions that the Console used to provide. Eliminating.
2014-12-06 17:42:07 -08:00
ekatek
25dfd39ef1 Everywhere that we call a raw function, add a new line 2014-12-06 17:38:41 -08:00
ekatek
24a4ed9bdc Automatically line-wrap output
Includes the following changes to Console.js:

- Console.info, Console.warn, Console.debug and Console.error now automatically
  line-wrap the output to 80 characters, or the width of the terminal screen (if
  known). This is in line with our current style guide on how things should be wrapped!

- Sometimes, there are parts of text that we don't want to line-wrap. For example, if we are
  telling the user to run 'meteor long-command --with --options' we don't want to
  have a newline in the middle of that! Wrap those commands in Console.command, like
  this:
     Console.info("something and then run", Console.command(command), "and then");
  This also makes them bold if chalk is on, as a nice bonus. So, if we ever turn
  chalk back on, the bolding of commands will be more consistent.

- Sometimes, there is bulkier output that we don't want to format at all, including
  line-wrapping: log snippets, stack traces, JSON output, etc. In that case, we can use
  Console.rawInfo, Console.rawError, Console.rawWarn and Console.rawDebug. Don't use
  Console.command inside the raw* functions! It won't be processed (at all).

- There are fancier things that we can do, other than just simply wrapping things.
  We can indent:
  "  Start here and then when wrapping
     continue over here".

  We frequently do this for commands, for example. In the past, we did this manually --
  but we can't do this for long messages that might get wrapped, and anyway, it is
  good to codify this instead of counting spaces. Allows us to be better about consistency,
  for example.

- We can also add a bulletPoint, which is a small notice in the beginning that looks like
  this:
  " => Start here and then when wrapping
       continue below the bulletPoint".

  Since it is a elss intuitive option, I have wrapped most of the time that we use a
  bulletPoint into helper functions on the Console.js.

- Some common bulletpoints that we use are:
    ASCII Checkboxes (Console.success)
    ASCII X-s (Console.failWarn and Console.failInfo)
    =>  (Console.arrowError, Console.arrowWarn, Console.arrowInfo)
    WARNING (Console.labelWarn)

  The => are sometimes indented, so they take an optional indent argument, showing how
  many spaces to indent by.

The wrapper interface would be less complicated, if there was a more unified conceit behind our
terminal messages. If there is one, it is not documented. My hope is that, in many cases,
moving these to Console will make it easier for someone with great product sense to
clean up our terminal messages. It will also make it easier to write such messages, since
it will be easier to follow an accepted standard.

In the codebase outside of Console:

- Went through and looked at our use of Console.error/info/etc, replacing with rawError/etc
  whenever approporiate.

- Went through and modified most of 'stdout' and 'stderr' calls to use the new functions.
  I made an exception for stuff that doesn't want a new line at the end, or otherwise does
  weird things (ex: print user logs directly), on the basis that, at this juncture, it is
  better to be safe than to be sorry.

- Long messages no longer need to break the code style guide by ignoring indentation rules.
  Fixed that where approporiate.

- Fixed the tests! A number of our stock messages are actually longer than 80 chars.

- Personal favourite: The Android license agreement is now line wrapped! Much better experience.

- There is some more work to do on:
  - longform help (currently comes with built-in linebreaks, would have to change the entire
    mechanism for how that works)
  - Buildmessage sometimes has headers that start with =>, but they are short. I didn't want to
    pass wrapper options all the way to main.captureOrExit before merging the rest of this and
    making sure that we like it. Since these messages are fairly short, I don't think that's
    likely to be a serious problem.

I hope that this makes life easier for us in the future! No more counting chars, no more breaking
the style guide. Better experience for users with wider terminals (or even shorter terminals!).
Let's give this a try.
2014-12-04 17:56:04 -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
0275afcfc9 maybe improve self-test 2014-11-25 09:06:31 -08:00
David Glasser
4949c396ab fix matches after process ends
fixes 'meteor exits when cordova platforms change'
2014-11-25 09:06:30 -08:00
David Glasser
7d856564fa fix releases tests
This mostly consisted of making sure we were building enough packages to
run the skeleton app.  Also, since we currently only know how to make
one tool at a time, dropped all the tests that checked the tool version
with --long-version.  (Before 0.9.0 there were multiple tool versions
here and you could actually tell the difference.)
2014-11-25 09:06:28 -08:00
David Glasser
46d31e1ce7 Fix update-related bugs
- don't crash when listing upgraders (2 bugs, introduced on this branch)

- successfully write banners-shown file so that we sometimes print
  shorter banners (introduced with sqlite)

- in self-test tropohouse, keep the sadly necessary symlinks

autoupdate test file now passes!
2014-11-25 09:06:28 -08:00
David Glasser
3b7459e62a start on self-test. file 'run' passes 2014-11-25 09:06:27 -08:00
David Glasser
490511a498 Move catalog refresh off of catalog.complete 2014-11-25 09:06:15 -08:00
David Glasser
8e484170ae Delete PackageLoader, references to it in new code
References are still sitting around in code that hasn't been
transitioned yet.
2014-11-25 09:06:14 -08:00
David Glasser
16d8a8e301 Read isopack-buildinfo.json; kill buildinfo.json 2014-11-25 09:06:11 -08:00
David Glasser
261a93b3dd Remove 'meteor rebuild' and rebuildLocalPackages
This is the first step in removing all references to
PACKAGESOURCE/.build.packagename caches. We will then implement a new
package cache from the ground up.
2014-11-25 09:06:08 -08:00
Sashko Stubailo
14735344f4 Revert "Change all uses of word elide to omit"
This reverts commit 442274f266.
2014-11-14 10:49:37 -08:00
Sashko Stubailo
442274f266 Change all uses of word elide to omit 2014-11-14 10:21:34 -08:00
David Glasser
3444b9a6d3 Remove support for earliestCompatibleVersion
This was an undocumented and entirely unused feature (only two dummy
packages on the package server have this set to a non-default value).

No attempt is being made to remove the field from existing isopacks or
catalog entries. To continue to support existing clients, the package
server has been modified to ignore any provided
earliestCompatibleVersion and instead always write the default ECV to
the catalog.
2014-11-10 13:33:41 -08:00
David Glasser
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00
David Glasser
9cab094f18 uniload now works via named "isopackets"
You can only request a named set of packages, not a random assortment.

In future commits, we will pre-build these packages into JsImages and
load them from that. Building packages for uniload will eventually not
involve the .build.foo directories at all.  (All saved packages will be
built in app context, eventually.)
2014-11-07 16:45:57 -08:00
David Glasser
1a2249d159 Get rid of many calls to doOrDie/doOrThrow
The things they wrap no longer make buildmessages.
2014-11-04 16:43:38 -08:00
Justin SB
8952e0e5d1 Bump self-test timeout for (fake) mongo start 2014-10-17 13:52:06 -07:00
Justin SB
d1c896724c We do need to cache the resolver after all; invalidate it correctly 2014-10-17 13:47:21 -07:00
David Glasser
f82d8d24cc include duration for passing tests 2014-10-17 13:24:44 -07:00
Justin SB
d46e14a0aa Don't print 'expected' error-exit from phantomjs 2014-10-13 16:24:32 -07:00
Nick Martin
4b1e713252 Revert "Run self-test in debug mode"
This reverts commit 7132c94e28.
2014-10-11 20:44:35 -07:00
Justin SB
7132c94e28 Run self-test in debug mode 2014-10-11 02:52:37 -07:00
ekatek
b8d927851a increment client cache format to v2
The client cache in sql-land was broken: it sent over the wrong sync token as the default.
This meant that the server thought that this was a much older client. As a result, any
0.9.3+ packages with '_' or '||' in their versions/dependencies were filtered out. There is no
easy way to undo that sort of filtering without deleting the db for a variety of reasons, and if
we are going to delete the db, we might as well increment the version so we don't have to worry about
consistency.
2014-10-08 22:31:37 -07:00
David Glasser
1df375d3a2 Fix test-package-server tag
... and also make some fixes to the 'update package server data' test,
though it's possible that only the other change is strictly necessary
2014-10-08 17:21:44 -07:00
David Greenspan
d7bae95deb Merge branch 'dgreensp-selftests' into 0.9.4
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2014-10-08 15:08:21 -07:00
David Greenspan
9dcc5e8780 Show list of failed tests 2014-10-08 15:05:57 -07:00
Justin SB
d25bfb7cd8 Log if phantomjs exits with error (e.g. missing libs) 2014-10-08 14:49:10 -07:00
David Greenspan
d87a1fe111 Edit some comments 2014-10-07 18:59:58 -07:00
David Greenspan
746fd0f792 Take a ––file regex; comments and usage 2014-10-07 15:59:05 -07:00
David Greenspan
4b1a781755 Support ––file option to self-test 2014-10-07 15:22:20 -07:00
David Greenspan
0c641fd7b3 Improve output of meteor self-test ––list 2014-10-07 15:09:33 -07:00
David Greenspan
ceda65f24b Refactor selftest.runTests and create listTests
Not extensively tested.  Needs comments describing options to the new functions (e.g. getFilteredTests) and updated usage for `meteor self-test ––list`.

Filtering and running tests now proceeds in stages
- Add “pseudo-tags” like non-matching and unchanged
- Remove tests whose tags are in a list of “tags to skip”
- Run or list the resulting TestList
- Optionally report skipped tests
- Optionally save the testState
2014-10-06 17:20:39 -07:00
David Greenspan
ded0601d0a Minor clarifications to self-tests code 2014-10-06 13:44:32 -07:00
Justin SB
90a24c9bd8 Check for meteor avd 2014-10-01 15:18:38 -07:00