Advertisement
Guest User

Full log

a guest
Oct 18th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.05 KB | None | 0 0
  1. mbp-aliaksei-2:culture banifaciy$ npm run test
  2.  
  3. > culture-front@2.0.41 test /Users/banifaciy/Work/fit/culture
  4. > nrun _test test/ --bail --timeout 10000 --recursive --reporter spec
  5.  
  6. > nrun _test
  7. > test -z $NODE_ENV && export NODE_ENV=developmentTest; lib/node/scripts/run.js lib/node/scripts/test.js "test/" "--bail" "--timeout" "10000" "--recursive" "--reporter" "spec"
  8. [info] Run tests "test/"
  9. [info] Starting related service from "/Users/banifaciy/Work/2do2go/social_posting"
  10. [log] Related service params: {"path":"/Users/banifaciy/Work/2do2go/social_posting","rev":"default","db":true,"env":"developmentTest"}
  11. [log] Drop database
  12. [log] Migrate database
  13. [log] Run server
  14. [info] Related service ready
  15. [info] Starting related service from "/Users/banifaciy/Work/fit/culture"
  16. [log] Related service params: {"path":"/Users/banifaciy/Work/fit/culture","rev":"default","db":true,"env":"developmentTest","dataSocket":"/tmp/related-service-data-developmentTest-1-1476797754493-98"}
  17. [log] Drop database
  18. [log] Migrate database
  19. [log] Run server
  20. [info] Related service ready
  21. [log] Start executing tests
  22.  
  23.  
  24. [Tue, 18 Oct 2016 13:36:08 GMT] [http request] http://127.0.0.1:6061/api/users: start requesting
  25. [Tue, 18 Oct 2016 13:36:08 GMT] [http request] http://127.0.0.1:6061/api/users: start requesting
  26. [Tue, 18 Oct 2016 13:36:08 GMT] [http request] http://127.0.0.1:6061/api/users: start requesting
  27. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: response time: 108ms
  28. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: done requesting
  29. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: get data time: 114ms
  30. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: response time: 123ms
  31. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: done requesting
  32. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: get data time: 124ms
  33. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: response time: 127ms
  34. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: done requesting
  35. [Tue, 18 Oct 2016 13:36:09 GMT] [http request] http://127.0.0.1:6061/api/users: get data time: 127ms
  36. Security checks
  37. Helpers
  38. hasSomeRights
  39. ✓ should throw error if rightsObj is empty
  40. ✓ should return false if organization is undefined
  41. ✓ should return false if roles is undefined in organization
  42. ✓ should return false if roles in organization is empty
  43. ✓ should return false if role locales in organization is empty
  44. ✓ should return false if all entityTypes are wrong
  45. ✓ should return true if some entityType is correct
  46. ✓ should return false if all rights are wrong
  47. ✓ should return true if some right is correct
  48. ✓ should return false if no available locales in roles
  49. ✓ should return false if not all locales in roles are available
  50. ✓ should return true if all locales in roles are available
  51. getOrganizationRightRoles
  52. ✓ should return [] if organization is undefined
  53. ✓ should return [] if roles is undefined in organization
  54. ✓ should return [] if roles in organization is empty
  55. ✓ should return [] if some entityType is wrong
  56. ✓ should return [] if some right is wrong
  57. ✓ should return ["moderator"] if organization has some role with rightsObj
  58. getOrganizationRightLocales
  59. ✓ should return [] if organization is undefined
  60. ✓ should return [] if roles is undefined in organization
  61. ✓ should return [] if roles in organization is empty
  62. ✓ should return [] if some entityType is wrong
  63. ✓ should return [] if some right is wrong
  64. ✓ should return [1,2,3] if organization has some role with rightsObj
  65. Middlwares
  66. ensureOrganization
  67. ✓ should redirect to url "?returnTo=%2Ftest" if organization _id is not set
  68. ✓ should redirect to url "?returnTo=%2Ftest" if organization is empty in session
  69. ✓ should redirect to url "?returnTo=%2Ftest" if organization does not exist with _id from session
  70. ✓ should be ok if organization exists with _id from session
  71. ✓ should throw error if organization does not exist with _id from headers
  72. ✓ should be ok if organization exists with _id from headers
  73. processUsersMeUrls
  74. ✓ should not replace url if it does not match
  75. ✓ should throw error if url is matched but req.user is not set
  76. ✓ should replace url if url is matched and req.user is set
  77. hasEntityRights
  78. ✓ should throw error if entityType is not set
  79. ✓ should throw error if entityType is unknown
  80. ✓ should be ok if entity _id is not set
  81. ✓ should be ok if entity does not exist
  82. ✓ should throw error if organization is not set in req
  83. ✓ should throw error if entity rights is empty
  84. ✓ should throw error if organization does not have passed rights
  85. ✓ should throw error if entity subordination is not in organization role locales
  86. ✓ should be ok if entity exists with _id from params and organization has rights
  87. ✓ should be ok if entity exists with _id from body and organization has rights
  88. ✓ should be ok if rights is array and organization has this rights
  89. isEntityOwner
  90. ✓ should throw error if entityType is not set
  91. ✓ should throw error if entityType is unknown
  92. ✓ should throw error if entity does not have organization field
  93. ✓ add fake organization field to moderation
  94. ✓ should be ok if entity _id is not set
  95. ✓ should be ok if entity does not exist
  96. ✓ should throw error if organization is not set in req
  97. ✓ should throw error if organization is not owner
  98. ✓ should be ok if entity exists with _id from params and organization is owner
  99. ✓ should be ok if entity exists with _id from body and organization is owner
  100.  
  101. Excel module
  102. ✓ Transform stream (821ms)
  103.  
  104. Articles api
  105. Article creating
  106. ✓ Create article with unexisting category (156ms)
  107. 1) Create article with unexisting locale
  108.  
  109.  
  110. 56 passing (2s)
  111. 1 failing
  112.  
  113. 1) Articles api Article creating Create article with unexisting locale:
  114. Error: expected 'Internal server error' to equal 'Locale with id 102 not found'
  115. at Assertion.assert (node_modules/expect.js/index.js:96:13)
  116. at Assertion.be.Assertion.equal [as be] (node_modules/expect.js/index.js:216:10)
  117. at Assertion.(anonymous function) [as be] (node_modules/expect.js/index.js:69:24)
  118. at Group.<anonymous> (test/3_api/articles.js:110:31)
  119. at Group.<anonymous> (node_modules/twostep/lib/twoStep.js:165:15)
  120. at next (node_modules/twostep/lib/twoStep.js:153:9)
  121. at Group.done (node_modules/twostep/lib/twoStep.js:30:16)
  122. at Group._fillSlot (node_modules/twostep/lib/twoStep.js:52:8)
  123. at node_modules/twostep/lib/twoStep.js:71:9
  124.  
  125.  
  126.  
  127. [log] Shuting down related services
  128. [log] Last related service data:
  129. [Tue, 18 Oct 2016 13:36:07 GMT] [cron job daemon] start
  130. [Tue, 18 Oct 2016 13:36:10 GMT] [start req #1476797770090-52] POST /api/2.2/articles | req.headers: {"content-type":"application/json","organization":"3","host":"127.0.0.1:4001","authorization":"Basic dGVzdEBtYWlsLmNvbToxMjM="} | user-agent: - | req.query: {} | req.body: {"category":"_intervyu","name":"testArticle","tags":[1],"locale":2,"image":{"name":"image.jpg","realName":"realName.jpg"},"content":[{"type":"text","text":"test text"},{"type":"images","images":[{"name":"image1.jpg","realName":"realName1.jpg"}]}]} | worker: -
  131. !!!!!!!!!!! { email: 'test@mail.com',
  132. password: 'beda020e7b7052f3bbce8445250be291' }
  133. [Tue, 18 Oct 2016 13:36:10 GMT] [auth] req.user: {"_id":2,"email":"test@mail.com","group":"admin"}
  134. [Tue, 18 Oct 2016 13:36:10 GMT] [app] There was an error at url "/api/2.2/articles":
  135. ValidatorError: Attribute `enum` of property `category` hasn`t pass check, expected value: `intervyu,reportazhi,fotootchety,scientificArticle` actual value: `_intervyu` error message: `must be present in given enumerator`
  136. at Error.ValidatorError (/Users/banifaciy/Work/fit/culture/node_modules/conform/lib/revalidator.js:531:13)
  137. at error (/Users/banifaciy/Work/fit/culture/node_modules/conform/lib/revalidator.js:493:17)
  138. at validateProperty (/Users/banifaciy/Work/fit/culture/node_modules/conform/lib/revalidator.js:336:7)
  139. at validateObject (/Users/banifaciy/Work/fit/culture/node_modules/conform/lib/revalidator.js:199:11)
  140. at Object.validate (/Users/banifaciy/Work/fit/culture/node_modules/conform/lib/revalidator.js:37:7)
  141. at module.exports (/Users/banifaciy/Work/fit/culture/lib/node/connect/validateParams.js:15:10)
  142. at IncomingMessage.req.validateParams (/Users/banifaciy/Work/fit/culture/lib/node/connect/reqValidateParams.js:11:13)
  143. at Group.<anonymous> (/Users/banifaciy/Work/fit/culture/routes/api/articles.js:375:23)
  144. at Group.<anonymous> (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:165:15)
  145. at next (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:153:9)
  146. at iterateSteps (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:158:7)
  147. at /Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:123:3
  148. at /Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:181:32
  149. at ApiResource.<anonymous> (/Users/banifaciy/Work/fit/culture/routes/api/articles.js:373:4)
  150. at /Users/banifaciy/Work/fit/culture/lib/node/connect/apiResource.js:166:16
  151. at callbacks (/Users/banifaciy/Work/fit/culture/node_modules/express/lib/router/index.js:161:37)
  152. [Tue, 18 Oct 2016 13:36:10 GMT] [finish req #1476797770090-52] POST /api/2.2/articles | status: 500 | res.headers: {"vary":"Accept-Encoding"} | isBadBrowser: - | isAuthenticated: true | uid: - | response-time: 86 ms
  153. [Tue, 18 Oct 2016 13:36:10 GMT] [start req #1476797770241-5] POST /api/2.2/articles | req.headers: {"content-type":"application/json","organization":"3","host":"127.0.0.1:4001","authorization":"Basic dGVzdEBtYWlsLmNvbToxMjM="} | user-agent: - | req.query: {} | req.body: {"locale":102,"name":"testArticle","category":"intervyu","tags":[1],"image":{"name":"image.jpg","realName":"realName.jpg"},"content":[{"type":"text","text":"test text"},{"type":"images","images":[{"name":"image1.jpg","realName":"realName1.jpg"}]}]} | worker: -
  154. !!!!!!!!!!! { email: 'test@mail.com',
  155. password: 'beda020e7b7052f3bbce8445250be291' }
  156. [Tue, 18 Oct 2016 13:36:10 GMT] [auth] req.user: {"_id":2,"email":"test@mail.com","group":"admin"}
  157. [Tue, 18 Oct 2016 13:36:10 GMT] [app] There was an error at url "/api/2.2/articles":
  158. ServerError: Locale with id 102 not found
  159. at Group.<anonymous> (/Users/banifaciy/Work/fit/culture/db/helpers.js:22:11)
  160. at Group.<anonymous> (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:165:15)
  161. at next (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:153:9)
  162. at Group.done (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:30:16)
  163. at Group._fillSlot (/Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:52:8)
  164. at /Users/banifaciy/Work/fit/culture/node_modules/twostep/lib/twoStep.js:71:9
  165. at nextTickCallbackWith0Args (node.js:420:9)
  166. at process._tickCallback (node.js:349:13)
  167. [Tue, 18 Oct 2016 13:36:10 GMT] [finish req #1476797770241-5] POST /api/2.2/articles | status: 500 | res.headers: {"vary":"Accept-Encoding"} | isBadBrowser: - | isAuthenticated: true | uid: - | response-time: 30 ms
  168.  
  169. [error] Error while spawn "node ./node_modules/.bin/_mocha --reporter spec --bail --timeout 10000 --colors --recursive test/": Non-zero exit code: 1
  170. [error] Error while spawn "lib/node/scripts/test.js test/ --related-services [{"path":"../../2do2go/social_posting","syncDeps":false,"db":true},{"path":"./","db":true}] --bail --timeout 10000 --recursive --reporter spec": Non-zero exit code: 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement