Commit Graph

92 Commits

Author SHA1 Message Date
David Glasser
738ffe50a1 fix missing expect() call in password-tests
add a console.trace that helps debug it
2013-12-12 00:21:57 -08:00
David Glasser
8de0ae58dc tinytest: test.equal should use EJSON.equals 2013-12-11 17:42:04 -08:00
Slava Kim
21b5e2acd8 Look for a file name ending with ":tests.js" as linker produces only such files. 2013-11-03 21:44:01 -08:00
David Glasser
af06112044 templating implies spark and meteor: generated code needs them.
also finish getting rid of deprecated startup package, and some other minor
packaging cleanups to templating.
2013-07-26 19:34:45 -07:00
David Glasser
4b3cb9d305 Rename api.exportSymbol -> api.export. 2013-07-25 18:54:43 -07:00
David Glasser
db51a3a14c Eliminate the "past" package.
This package was always included in apps, and even if it was possible to remove,
there wasn't a compelling story about when users would remove and replace
it. Plus, not all backwards-compatibility code could even live in it (eg, field
names of objects), so it was incomplete. It also introduced odd load order
constraints.

Instead, we introduce two conventions for backwards-compatibility code:

  - Special comments of the form "// XXX COMPAT WITH 0.6.4"
  - When feasible, put backwards-compatibility code in a file called
    "deprecated.js" in the relevant package.

This is documented at:
https://github.com/meteor/meteor/wiki/Meteor-Style-Guide#deprecated-code-and-backwards-compatibility

Additionally, removed some symbols that existed for backwards compatibility with
Meteor 0.4.0 (changes made 10 months ago): Meteor.is_client, Meteor.is_server,
and (in a method) this.is_simulation.
2013-07-25 18:54:42 -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
David Glasser
6a1b5d3032 Consistently use fut['return']() in package code.
Some package code is loaded in browsers, which may fail to parse code which uses
'return' or 'throw' as a method name.  We used to inconsistently use fut.ret for
this purpose; instead, just consistently use fut['return'] and fut['throw']. We
don't bother to do this in tools code which is definitely never run outside of
Node.

Also remove some unused requires.

Fixes #1222.
2013-07-15 21:39:03 -07:00
Geoff Schmidt
0b2d536e38 Clean up error reporting in HTML template scanner 2013-05-13 11:56:51 -07:00
Geoff Schmidt
1049c2d7d2 add missing dependencies (following rebase on devel) 2013-05-13 11:54:20 -07:00
David Glasser
6b48e8bd8a stuff that doesn't have conflicts 2013-05-13 11:51:50 -07:00
David Glasser
8dbee56e77 Add .gitignore to package directories to match linker branch.
This way switching between linker and devel doesn't leave you with lots of junk
in git status.
2013-05-13 10:57:37 -07:00
Andrew Wilcox
1f7627582b Clearer error message when calling Meteor.Collection without "new".
Fixes #457.

Add an optional "expected" predicate to Tinytest's throws.
2013-05-06 16:04:18 -07:00
David Glasser
f67db983c3 New check library. 2013-04-18 19:17:53 -07:00
David Glasser
5a5204e3a4 Remove closures around package files. (hint: git blame -w)
The bundler now adds closures around client files and the server adds closures
around server files.
2013-03-19 15:13:53 -07:00
Avital Oliver
78ca755d3d Npm.require unified requireNpm and __meteor_bootstrap__.require 2013-03-19 15:11:04 -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
David Glasser
3f2aad7c0e Rename subscription "complete" to "ready" everywhere (including in the
protocol and the publisher API).

Also update examples/other/quiescence for ddp-pre1.
2013-01-30 13:34:58 -08:00
David Glasser
99bceb936e Replace Mongo binary types with Meteor binary types on the way in and out of
Mongo.

(Should consider doing the same with ObjectId.)

(Also, still need to delete 0.2.15.)
2013-01-29 22:43:53 -08:00
Naomi Seyfer
c10c7f7c91 Binary support in BSON (dev bundle wise) and in Mongo
Unfortunately, the Node Mongo driver wants to use its own proprietary
Binary type for binary data.  We want to use Uint8Array, instead, so
we're going to be using a patched version of the BSON library that
allows this.

It allows us to install a handler for USER_DEFINED binary types, which
in our case we set up to recognize, accept, and provide Uint8Array
2013-01-24 14:47:37 -08:00
Naomi Seyfer
76dba0150d Fix tinytest include to use _.isEqual 2013-01-17 15:42:34 -05:00
Naomi Seyfer
3b16ca8aa6 Various tests for new data types in DDP:
Test for a document with a date; full stack

Test and fix for method invocation with a Date

Tests for literal
2013-01-17 15:29:51 -05: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
2aa92b2ed3 Update to use APIs from new versions of fibers and uglify-js.
Combine files before minimizing.

minimongo - subkey sort fails when minized, so clearly there is some sort of
uglify bug.
2013-01-16 11:34:30 -05:00
David Glasser
25af4e5cdb http: Fix test failure on FF caused by 3bada2a. 2013-01-03 14:56:02 -08: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
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