Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix broken UTs in mojit skeletons #395

Merged
merged 2 commits into from

3 participants

@FabianFrank

the renamed tests require the DOM and therefore need to have set the client archetype until mojito provides them a DOM on the server. today mojito creates apps that crash during mojito test. a lot of people reported this during the open hack day in bangalore, after they started playing with mojito.

FabianFrank added some commits
@FabianFrank FabianFrank fixing unit test affinity in mojit archetypes
the renamed tests require the DOM and therefore need to have set the client archetype until mojito provides them a DOM on the server. today mojito creates apps that crash during mojito test. a lot of people reported this during the open hack day in bangalore, after they started playing with mojito.
b6a4fff
@FabianFrank FabianFrank Merge branch 'master' of github.com:yahoo/mojito into fix-skeleton-ut 22fc0ac
@mridgway

Why do the binders even have an affinity? Aren't they always client? Most apps that I've seen don't have an affinity on the binders.

@FabianFrank

The binders don't have an affinity, but the tests have. IMHO this makes sense, because it makes sense to run binder tests on the server (for convenience, faster builds).

@mridgway

Binder tests inherently require the DOM. I agree they should be able to run on the server using something like PhantomJS and we plan on addressing this with Arrow, but the affinity should still be client. I'm going to merge this since it's a no brainer.

@mridgway mridgway merged commit ebaf86f into from
@FabianFrank

Thanks @mridgway. FYI, we are running them on the server in Axis today, by injecting the dom dependency into YUI as explained on http://yuilibrary.com/yui/docs/yui/nodejs-dom.html.

@mridgway mridgway was assigned
@ramses0

Pulling yahoo:develop and re-running stuff worked well.

INFO mojito-dispatcher: Dispatching an instance of 'hello/index' with the modules: [HelloMojitModelFoo, mojito-perf, mojito, HelloMojit, mojito-config-addon, yui-base, json-stringify, oop, event-custom-base, mojito-view-renderer, array-extras, mojito-util, mojito-output-adapter-addon, querystring-parse, querystring-stringify, querystring-stringify-simple, mojito-route-maker, mojito-url-addon, mojito-assets-addon, mojito-http-addon, mojito-cookie-addon, mojito-params-addon, mojito-composite-addon, mojito-action-context, mojito-controller-context, mojito-resource-store-adapter, intl-base, event-custom-complex, intl, mojito-dispatcher, mojito-hb, mojito-mu]

status
Mojito is working.

data
some: data

The old error message for posterity (after changing affinity from server to client):

INFO mojito-dispatcher: Creating controller context
WARN Server OutputHandler: Error 404: Mojit controller prototype is not an object! (mojit id: 'hello')
Error: Mojit controller prototype is not an object! (mojit id: 'hello')
at Object.YUI.add.ControllerContext.init (/usr/local/lib/node_modules/mojito/lib/app/autoload/controller-context.common.js:46:25)
at Object.ControllerContext (/usr/local/lib/node_modules/mojito/lib/app/autoload/controller-context.common.js:21:14)
at YUI.add.store.expandInstance.groups (/usr/local/lib/node_modules/mojito/lib/app/autoload/dispatch.common.js:247:30)
at proto._notify (/usr/local/lib/node_modules/mojito/node_modules/yui/yui-nodejs/yui-nodejs.js:836:17)
at proto.use (/usr/local/lib/node_modules/mojito/node_modules/yui/yui-nodejs/yui-nodejs.js:807:19)
at runMojit (/usr/local/lib/node_modules/mojito/lib/app/autoload/dispatch.common.js:287:45)
at modulesLoaded (/usr/local/lib/node_modules/mojito/lib/app/autoload/dispatch.common.js:338:21)
at YUI.add.Y.namespace.Dispatcher.init.store (/usr/local/lib/node_modules/mojito/lib/app/autoload/dispatch.common.js:366:25)
at Object.YUI.add.Loader.load (/usr/local/lib/node_modules/mojito/lib/app/autoload/loader.common.js:34:17)
at YUI.add.Y.namespace.Dispatcher.init.store (/usr/local/lib/node_modules/mojito/lib/app/autoload/dispatch.common.js:360:28)

@FabianFrank

Sounds like you might have changed the affinity of the controller instead of the test. Only change the test's affinity!

@ramses0

Thanks for the note... I did change the controller affinity when I was "messing around trying to fix what I didn't know was broken". But this pull request fixed everything so I wasn't getting any error messages. I just wanted to share what was the error message I had gotten before as I didn't include the details in the previous issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 15, 2012
  1. @FabianFrank

    fixing unit test affinity in mojit archetypes

    FabianFrank authored
    the renamed tests require the DOM and therefore need to have set the client archetype until mojito provides them a DOM on the server. today mojito creates apps that crash during mojito test. a lot of people reported this during the open hack day in bangalore, after they started playing with mojito.
  2. @FabianFrank
This page is out of date. Refresh to see the latest.
View
0  ...it/default/tests/binders/index.common-tests.js.hb → ...it/default/tests/binders/index.client-tests.js.hb
File renamed without changes
View
0  ...mojit/full/tests/binders/index.common-tests.js.hb → ...mojit/full/tests/binders/index.client-tests.js.hb
File renamed without changes
Something went wrong with that request. Please try again.