Commit Graph

24 Commits

Author SHA1 Message Date
Justin SB
812a3af2cd By default, don't run server & client tests in parallel 2014-07-30 14:37:27 -07:00
Emily Stark
019736096b tinytest: don't pass msg.fields into _.has if it's falsey. 2014-07-14 15:28:03 -07:00
Justin SB
2ac9da43f9 tinytest/run now returns immediatedly; sends a 'complete' record when finished
Otherwise the DDP call to tinytest/run was blocking client test execution,
in particular Accounts DDP calls won't run concurrently with another DDP call,
even if the first DDP call calls unblock.
2014-07-14 13:44:41 -07:00
David Glasser
9f38258b54 Drop all @export lines. Add api.exportSymbol instead. 2013-07-25 18:54:40 -07:00
Geoff Schmidt
3d1c09794f Comprehensive namespace cleanup. 2013-07-25 18:54:40 -07:00
Naomi Seyfer
aefe645f6c work towards allowing you to solo groups of tests easily 2013-02-18 12:09:03 -08:00
David Glasser
d2ae5f7e1c Replace almost all uses of Meteor.uuid with Random.id. 2013-02-12 23:55:19 -08:00
David Glasser
e95bcb870c Get rid of duplicate random code inside minimongo.
Temporarily move the objectid-specific function into random.js.
2013-02-12 23:49:43 -08:00
Naomi Seyfer
a9104afe5b Attempting to get set userid working 2013-01-17 15:23:24 -05:00
Naomi Seyfer
052e393203 tinytest support for ddp-pre1 2013-01-17 15:23:23 -05:00
David Glasser
cd250f0945 tinytest: drop results for a run when requested by client, not onComplete.
Should be useful for a non-browser-based test runner.
2012-12-12 12:55:44 -08:00
David Glasser
f8c54c4046 Overhaul quiescence, method callback timing, and login methods on the client.
- Data streamed from the server is quiesced on a per-object basis, not a global
  basis. We track which documents a method stubs modifies, and create individual
  snapshots ("server documents") of those documents rather than whole-Collection
  snapshots. Data writes from the server to documents not modified by stubs are
  applied immediately to the local cache; other writes are applied to the
  "server document" snapshots. Server documents are flushed to the local cache
  when all method stubs that wrote to the document have sent their "data write"
  message.  (We still do "full database" quiescence after a reconnect.)

- Instead of calling method callbacks as soon as the result is received, we wait
  until all data that precedes their "data done" message is flushed to the local
  cache. This way, method callbacks can see all of their results locally. (This
  applies to Collection mutator callbacks as well.) If this delay is
  unacceptable, you can also specify the onResultReceived option to
  Meteor.apply; this callback is given the method result as soon as it comes in,
  and there's no guarantee that the local cache is up to date.
  (This is a client-only change: server-side callbacks do not block on the
  write fence.)

- Methods invoked with the "wait" option to Meteor.apply now wait until all
  preceding methods are fully finished to be *sent*, not just to call their
  callbacks. ie, previous calls block the "wait" method in the same way that
  "wait" methods block subsequent calls.

- Remove Meteor.userLoaded and {{currentUserLoaded}}.
  Meteor.userId() is now set only at the point where Meteor.user() is fully
      loaded.
  Current user data is published via an unnamed subscription, not via
      "meteor.currentUser".
  Replace them with Meteor.loggingIn() and {{loggingIn}}, which become true
      as soon as the login method is sent (instead of only once it succeeds).
  In accounts-ui, move the spinny into the dropdown, because it now shows up
      before error messages would.

- Previously, if we received the "result" message from a method but no "data"
  message, and then disconnected and reconnected, quiescence would be
  permanently blocked. Now, not only do we allow the app to continue working,
  but we even guarantee that the method's callback will be called at the
  "reconnect quiescence" point.

- Remove reset function from the Store API (the interface between
      _LivedataConnection and Collection), and add a boolean "reset" argument to
      beginUpdate instead.
  Add saveOriginals/retrieveOriginals functions to the Store API (pass-through
      to minimongo implementation).
  Allow "replace" messages to be passed to the Store API's update function
      (in addition to set/unset).
  Allow Store API implementations (eg tinytest_client) to not specify all
      functions.

- Server-side tinytest results now stream into the result page instead of
  appearing all at once at the end.

- Rename fields and methods of Meteor._LivedataConnection as camelCase, and
  prepend all internal fields with _.

- Different Meteor._LivedataConnection objects now have separate
  _userIdListeners _ContextSets.

- Remove snapshot/restore functionality from Minimongo collections. (Individual
  queries still have result snapshots.) The "server documents" in
  Meteor._LivedataConnection serve the equivalent purpose.

- Meteor.loginWithToken's callback is now a "call with error on error, call
  with no args on success" callback like the other login callbacks.

- The test-only Meteor._LivedataConnection.onQuiesce function is removed.
  Every single use of it is now supported by normal method callbacks.
2012-11-14 18:10:08 -08:00
David Glasser
32035e8039 Replace _ServerTestResults collection with custom pub/sub.
This gets rid of some awkward GC code, and as a bonus gives us a second example
usage of the registerStore API.
2012-10-29 12:21:34 -07:00
matt debergalis
f95082d519 semicolon 2012-05-08 15:39:14 -07:00
Geoff Schmidt
ef46d1ea58 eliminate App, proxy methods from Meteor 2012-03-16 02:55:14 -07:00
Geoff Schmidt
14d41036f4 Simplify subscription API
- Use positional arguments
- Pass the subscription object in 'this'
2012-03-06 15:44:42 -08:00
Geoff Schmidt
0822bd410f rework public API for running tests 2012-03-02 05:08:06 -08:00
Geoff Schmidt
c2302c9e46 factor dynamic variable fully into tinytest.js 2012-03-02 03:27:55 -08:00
Geoff Schmidt
a0877e26be move driver entrypoints from 'test' to 'tinytest' 2012-03-02 03:18:18 -08:00
Geoff Schmidt
60913bfd6f Notify observers asynchronously, add write fencing 2012-03-02 01:41:06 -08:00
Geoff Schmidt
4f04e0fb6a don't offer to debug server tests on the client 2012-02-29 01:47:42 -08:00
Geoff Schmidt
16b2de8e8c show overall test status
(makes it easier to see if server tests haven't returned)
2012-02-29 01:08:22 -08:00
Geoff Schmidt
f41d692cf5 method invocation context object
(including support for async methods, server-side
method ordering, running simulated methods
correctly)
2012-02-29 00:42:38 -08:00
Geoff Schmidt
97c3e50379 Support server-side tests. 2012-02-23 06:08:09 -08:00