Commit Graph

56 Commits

Author SHA1 Message Date
Ben Newman
6e1346a74b Remove phantomjs-prebuilt from the dev bundle.
Saves 50MB from the extracted size of the dev_bundle/lib/node_modules
directory, previously 262MB. The entire dev bundle is 332MB extracted, for
perspective.

More importantly, since the `phantomjs` binary is not very compressible,
this change reduces the *compressed* size of the dev bundle from 71MB to
54MB, a 24% savings.

Closes #6905.
2016-05-17 11:50:48 -04:00
Ben Newman
727624a2f7 Bump dev bundle package versions to work with newer Node versions. 2016-05-16 18:21:11 -04:00
Ben Newman
d94e7d812d Upgrade dev bundle meteor-promise to 0.7.1. 2016-05-16 18:21:11 -04:00
Martijn Walraven
0486b473e8 Make some more self tests pass 2016-03-18 20:40:57 +01:00
Martijn Walraven
8ea1e27656 Log client restart before restarting client to get self tests passing 2016-03-18 20:40:56 +01:00
Martijn Walraven
0714048b34 Revert "Improve Runner.start logic"
This reverts commit 1032f271e9.
2016-03-17 22:33:56 +01:00
Ben Newman
1a1f8327c6 Avoid depainting console messages after server restarts.
Fixes #6226.
2016-03-14 17:07:17 -04:00
Tom Coleman
96c802edb4 Correct behavior for setting buildMode/NODE_ENV 2016-03-14 11:18:23 +11:00
Ben Newman
730e713592 Allow values other than "development" and "production" for $NODE_ENV. 2016-03-11 21:30:19 -05:00
Tom Coleman
50540e5e28 Merge branch 'aldeed-pr' into release-1.3 2016-03-12 10:55:20 +11:00
Eric Dobbertin
1032f271e9 Improve Runner.start logic
No visible changes
2016-03-11 15:09:41 +11:00
Tom Coleman
2c617225cd Ensure that runAll always sets NODE_ENV+buildMode sensibly.
Note there are a few use cases I can think of we want to worry about:

`meteor run` -- both should be "development"
`meteor run --production` - both should be "production"
`NODE_ENV=production meteor run` - as above
`NODE_ENV=development meteor run --production` - `--production` should win
`meteor test` - NODE_ENV should be "development", buildMode should be "test"
`NODE_ENV=production meteor test" - NODE_ENV should be "production", buildMode should be "test"
2016-03-11 12:29:36 +11:00
Tom Coleman
b6c2ecf5fc A couple of small typos 2016-03-10 09:37:11 +11:00
Tom Coleman
27faeefb31 Pass test metadata in via an environment variable.
[Only works on the server right now, fairly uselessly]

For #6331
2016-03-09 15:30:45 +11:00
Ben Newman
40857bdaff Propagate meteorEnv subset of process.env from server to client.
Fixes #6399.
2016-03-08 19:37:57 -05:00
Tom Coleman
7f4d9706b8 Make meteor run --once not quiet. #6359 2016-03-03 12:10:59 +11:00
Avital Oliver
a335875e19 Merge remote-tracking branch 'origin/release-1.3' into app-tests 2016-02-05 14:57:44 -08:00
David Greenspan
e50b182772 Avoid infinitely re-running the app on error
Bump up the crashCount reset delay from 3 seconds to 8 seconds.

If the delay is smaller than app start-up time, then an app that
crashes at start-up will be treated as an app that crashed while
running and will be automatically restarted, and this will lead to
an infinite loop of restarting.  Making the delay longer just increases
the time right after app start where a crash counts towards the max of
three restarts in a row.  For example, if we upped the delay to 60
seconds, then an app that crashed in its first minute would restart but
gain a crashCount of 1, and if there were two more crashes within the
first minute of running (without another crash *not* within the first
minute to reset the counter), the app would fail to automatically
restart.

This whole mechanism is a little janky and was written way way back.
The number 3 was previously 2, but app start-up got a little bit slower.
Hopefully the number 8 will last us until this code is replaced.
2016-02-05 01:18:17 -08:00
David Greenspan
fabb20d2cd Rebuild in place for better performance
writeSiteArchive already supported rebuilding in place (rather than
creating a new build directory and moving it into place; see comments
at top of builder.js), but it was not used and didn't work:

* run-app.js only passed previousBuilders to the bundler in the case
  of a client-only refresh, in which case it also passed
  hasCachedBundle, bypassing writeSiteArchive altogether.

* writeSiteArchive's use of previousBuilders seemingly didn't work,
  because the site archive itself was never written in place, so
  trying to write the targets "in place" into a brand-new build
  directory didn't make sense (and threw an error).

With this change, previousBuilders are kept across all rebuilds
(not just client-only refreshes), which enables efficient, in-place
building (except on Windows, where in-place building has never been
supported), and writeSiteArchive is fixed to write the site archive
in place as well.
2016-02-04 17:11:39 -08:00
David Greenspan
2fca3a9599 Profile more of tool and improvements to Profile
Previously, we would generate reports on
"Selecting Package Versions" and "Rebuild App".

- Instead of just profiling constraint solving, profile the entire
  process of preparing the project via ProjectContext, by giving
  each public function that "advances the stage" a Profile.run
  (typically prepareProjectForBuild).
- Improve profiler output to better distinguish multiple runs
- Distinguish "Build App" and "Rebuild App"
- Instrument lots of calls that weren't instrumented before
2016-02-03 11:54:05 -08:00
Avital Oliver
ac5a4bc809 WIP: Implement a meteor test-app command.
This command builds the app with a different directory for
`.meteor/local`, including built packages and the app database. This
allows running `meteor test-app` and `meteor test` in parallel
for a given app, with DB isolation.

Also, we've changed how test driver packages work (as used for
`meteor test-packages`, like "test-in-browser"). Instead of automatically
running tests when they load, they export a `runTests` function that
you should call when you're ready to run tests.

When running `meteor test-app` or `meteor test-packages` a new additional
last line of code is added that calls `Meteor.startup(...runTests()...)`

TODO:
* Implement `testOnly` packages. The current pattern of reading a global
  from `package.js` won't work for published packages, which are stored
  as metadata, not code.
* Let you choose a test driver package as an argument to `meteor test-app`
* Demonstrate that a Mocha test and driver package are possible to write.
* Expose Meteor.isTest, Meteor.isIntegrationTest, Meteor.isUnitTest
* Implement `meteor test-app --unit` which only loads test files
* `meteor test-app` should load ALL *.tests?.* files, including ones
  inside imports/ directories
2016-01-22 15:18:10 -08:00
Ben Newman
3cafbc72ac Use async functions to eliminate the need for fiberHelpers.inBareFiber.
The comments for inBareFiber claim that it's for times when you don't want
to inherit the dynamic environment variables of the current Fiber, but
none of the call sites actually relied on this behavior. Still, it may be
worth noting that async functions automatically (and cheaply) inherit the
calling Fiber's dynamics, which is virtually always what you want.
2015-12-09 12:06:51 -05:00
Ben Newman
58fcc8d49e Use an async method to start Mongo in a Fiber. 2015-12-09 12:06:51 -05:00
Ben Newman
9a466d2efa Eliminate Future from tools/run-mongo.js. 2015-12-09 12:06:50 -05:00
Ben Newman
d1d0734682 Eliminate Future from tools/run-selenium.js. 2015-12-09 12:06:48 -05:00
Ben Newman
2b6647fc2a Eliminate Future from tools/run-proxy.js. 2015-12-09 12:06:48 -05:00
Ben Newman
d245199737 Eliminate Future from run-{all,app}.js, in favor of Promise.
Any code that has access to a Future object also has the capability of
calling its .return method. Promise objects, by contrast, can only be
resolved or rejected by the creator of the Promise (or any code granted
access to the special resolve and/or reject functions, which are not
simply methods of the Promise object). The run-app.js file contains a lot
of code that used to assume a Future could be resolved by anyone, which is
why the _{make,resolve}Promise methods were necessary.

For this reason, replacing Future with Promise in these two files seemed
tricky and worth attempting first, before spending time converting easier
files.
2015-12-09 12:06:45 -05:00
Ben Newman
ed17924940 Add braces to every if/for(-in)/while statement in tools directory. 2015-11-13 12:25:19 -05:00
Tom Freudenberg
8a24a1b2ba Make Script More Portable With #!/usr/bin/env 2015-11-01 22:04:10 +01:00
Sashko Stubailo
0f94cb20bc Convert to HTML error page
One big reason we need this is that the text format doesn't work on Windows
because of line endings. We could just replace the line endings based on
platform, but this seemed better overall.

Also, make sure to escape entities in HTML error page
2015-09-17 11:12:32 -07:00
Martijn Walraven
d58c4104fa Fix crash on server refresh for Cordova app due to variable rename
Fixes #5140
2015-09-12 19:17:52 +02:00
David Glasser
71cf002daa Fix client refresh
Since 87b11bd we were treating client-only refreshes of the initial
server build as if they were initial builds, and not resetting the
project context.  This meant among other things that local packages
weren't being rebuilt, which led to #5074 (but also would have led to a
whole bunch of other problems).

Fixes #5074.
2015-09-02 15:16:28 -07:00
Martijn Walraven
3281e5389b Rename pluginsFromStarManifest to pluginVersionsFromStarManifest 2015-09-02 16:30:33 +02:00
Martijn Walraven
7038a49338 Don't create runFuture until after building for Cordova so we can still restart 2015-09-02 16:30:32 +02:00
Martijn Walraven
09c875ff04 Start Cordova run targets after starting the server app 2015-09-02 16:30:32 +02:00
Martijn Walraven
a5b49b8aa4 Exit when running platforms are removed or plugins changed 2015-08-26 19:26:54 +02:00
Martijn Walraven
0538dc1f28 Some changes to the buildmessage structure and job naming 2015-08-26 19:26:54 +02:00
Martijn Walraven
6e622a36f6 Revert "Temporarily print errors until meteor-promise exception handling is fixed"
See https://github.com/meteor/promise/issues/2.
2015-08-26 19:26:50 +02:00
Martijn Walraven
141e800c9c Keep track of when Cordova runner has been started to not just start on first run 2015-08-26 19:26:50 +02:00
Martijn Walraven
59e16c3408 Starting run targets should happen within a capture 2015-08-26 19:26:50 +02:00
Martijn Walraven
22cce1c316 Improve debug output and error reporting 2015-08-26 19:26:50 +02:00
Martijn Walraven
87b11bdab5 Cordova refactoring and change of runner behavior
- Refactored code in tools/cordova and introduced CordovaBuilder and
CordovaRunTarget classes
- CordovaRunner now builds and runs the project as part of the main
runner loop
- Some code cleanup and ES2015 conversions
2015-08-26 19:26:49 +02:00
Martijn Walraven
d21bddeece Temporarily print errors until meteor-promise exception handling is fixed
See https://github.com/meteor/promise/issues/2
2015-08-26 19:26:48 +02:00
Martijn Walraven
dd023b59ee Remove unused HttpProxy and related config options 2015-08-26 19:26:48 +02:00
Martijn Walraven
7d34b1296b Split up and sanitize cordova-commands.js, use cordova-lib 2015-08-26 19:26:45 +02:00
Slava Kim
a2590ead6a mention run-log in runners' readme 2015-08-10 12:01:21 -07:00
Slava Kim
afee6b07c7 move catalog/ into packaging/ 2015-08-06 16:39:01 -07:00
Slava Kim
39d8aef3d9 move files into console/ tool-testing/ 2015-08-06 16:39:00 -07:00
Slava Kim
f49de5b9ac Move files connecting to Meteor-provided services
to a separate folder
2015-08-06 16:00:39 -07:00
Slava Kim
76b001d0da Kill some dead code 2015-08-05 15:03:53 -07:00