Commit Graph

63 Commits

Author SHA1 Message Date
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
5b066c77a0 Remove stray debugging log from previous commit. 2012-11-17 17:53:00 -08:00
David Glasser
637692db31 Add filename and line number to test failures using a v8 stack trace API.
This works for server tests (Node uses v8) or for client tests in Chrome.  Uses
a simple heuristic to guess which line in the stack trace is most likely to be
the actual high-level assertion. Adjustments to this heuristic and
implementations for other browsers are welcome :)
2012-11-17 17:46:57 -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
Tom Wijsman
8f83b2c32e Made sure all file system related statements use proper path.join and path.sep to support other platforms. 2012-10-30 15:53:49 -07: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
David Glasser
9b9d07d773 Create indices on all Meteor.users fields on which we do queries.
Rely solely on indices (with some icky error parsing) to generate "user/email
already exists" errors.

Not yet making the ensureIndex API public. Not indexing the tiny
loginServiceConfiguration collection. Indexing tinytest_results.
2012-10-09 23:12:16 -07:00
Nick Martin
3feefd3cda Merge remote-tracking branch 'origin/devel' into auth 2012-09-24 22:36:15 -07:00
David Greenspan
4b25e2d82d fix tinytest error message bug 2012-09-24 12:12:42 -07:00
David Glasser
af741cc245 Merge branch 'devel' into auth
Conflicts:
	examples/todos/.meteor/packages
	examples/wordplay/.meteor/packages
2012-09-17 15:07:48 -07:00
David Glasser
374dd8f39b Make sure under_score names work in package tests. 2012-09-17 15:03:06 -07:00
David Glasser
2fedd2adfc Merge branch 'devel' into auth
Conflicts:
	packages/livedata/livedata_common.js
	packages/livedata/livedata_connection.js
	packages/livedata/livedata_server.js
	packages/mongo-livedata/collection.js
2012-09-17 14:42:10 -07:00
David Glasser
42033a03aa Merge branch 'devel' (early part) into auth
Conflicts:
	packages/email/email.js
	packages/email/email_tests.js
	packages/livedata/livedata_tests.js
2012-09-17 14:31:54 -07:00
David Glasser
5e622215ba Change all publicly documented APIs to use camelCase.
For now, the old names still work as well.

This includes:
  - Meteor.isServer/isClient
  - this.isSimulation in methods
  - Context.onInvalidate
  - Meteor.status().retryCount/retryTime

Remove old backwards-compatibility "Sky" alias for "Meteor".

Update all examples in the docs to use camelCase.

Delete unused docs/client/projects.html file.
2012-09-17 14:26:45 -07:00
David Greenspan
5d9ff80461 Remove special Tinytest timer functions 2012-09-16 00:34:54 -07:00
Avital Oliver
b227d59b54 Access control for default collection mutators
- A new `insecure` package reproduces the experience we had
  before this change, in which all collections are by default
  totally open to all changes
- With or without the `insecure` package, you can now call
  collection.allow() to define which calls to the default
  mutator methods should be allowed
2012-07-23 17:57:11 -07:00
matt debergalis
f95082d519 semicolon 2012-05-08 15:39:14 -07:00
David Greenspan
4bd98aa38a tinytest/run method now threads the write fence more than before 2012-04-17 20:13:22 -07:00
Nick Martin
ce1f551a86 Fix typo in tinytest. 2012-04-17 20:13:22 -07:00
David Greenspan
d1b7c60360 tinytest: deal correctly with 0 server tests and async join 2012-04-11 15:01:52 -07:00
David Greenspan
81c1de24e3 run tests "in parallel" on client if sync and in different groups 2012-04-03 22:37:12 -07:00
David Greenspan
bf04fccb72 new query diffing algorithm with fuzz tests 2012-04-03 22:37:11 -07:00
Nick Martin
5a1ecf6d16 Events test helper, plus misc test fixups. 2012-03-28 18:26:15 -07:00
David Greenspan
4f0c7d061d test.equal -> deep compare, not stringify compare 2012-03-28 18:26:15 -07:00
Geoff Schmidt
3b520997b1 tinytest: support some additional assertions 2012-03-16 21:11:07 -07:00
Geoff Schmidt
6de5ab62ce Simplify method API 2012-03-16 02:55:14 -07:00
Geoff Schmidt
784529a9af tighten up exception reporting in async tests 2012-03-16 02:55:14 -07:00
Geoff Schmidt
ef46d1ea58 eliminate App, proxy methods from Meteor 2012-03-16 02:55:14 -07:00
Geoff Schmidt
dc880b1d1e Additional tests for Meteor._delete 2012-03-07 01:47:35 -08:00
Geoff Schmidt
168bc8e570 FF10 fix -- ignore the spurious argument that
FF10 passes to timer callbacks.
2012-03-07 00:24:53 -08:00
Geoff Schmidt
3dc8dc2887 Permit fine-grained control of database polling.
You can now used invalidation keys to specify exactly what will get polled when.
2012-03-06 15:44:42 -08: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
76c57526f7 rework public API for defining tests 2012-03-02 05:22:40 -08:00
Geoff Schmidt
7729b7d887 make private tinytest symbols private 2012-03-02 05:13:41 -08:00
Geoff Schmidt
0822bd410f rework public API for running tests 2012-03-02 05:08:06 -08:00
Geoff Schmidt
74dbbf3419 clean up test reporting plumbing 2012-03-02 04:43:03 -08:00
Geoff Schmidt
601f20553e Get rid of all global state in tests 2012-03-02 04:22:57 -08:00
Geoff Schmidt
cab5afbb91 move test reporting functions out of globals 2012-03-02 03:57:30 -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
bc69d57e16 Give each test run a unique ID 2012-03-02 02:32:32 -08:00
Geoff Schmidt
60913bfd6f Notify observers asynchronously, add write fencing 2012-03-02 01:41:06 -08:00
matt debergalis
3f1ff26e43 Convert to new publish API. 2012-02-29 16:08:59 -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
Geoff Schmidt
e0722bedf8 basic livedata method invocation tests 2012-02-21 01:40:15 -08:00
Geoff Schmidt
8cf92b18ef reinstate ability to open debugger on a test
(also, restore ability to catch exceptions in tests)
2012-02-20 23:58:59 -08:00
Geoff Schmidt
6acaeb0ee6 refactor tinytest for async 2012-02-20 22:12:31 -08:00