{"action":"created","issue":{"url":"https://api.github.com/repos/softwerkskammer/Agora/issues/1190","repository_url":"https://api.github.com/repos/softwerkskammer/Agora","labels_url":"https://api.github.com/repos/softwerkskammer/Agora/issues/1190/labels{/name}","comments_url":"https://api.github.com/repos/softwerkskammer/Agora/issues/1190/comments","events_url":"https://api.github.com/repos/softwerkskammer/Agora/issues/1190/events","html_url":"https://github.com/softwerkskammer/Agora/pull/1190","id":192615288,"number":1190,"title":"Separate unit and integration tests","user":{"login":"c089","id":327199,"avatar_url":"https://avatars.githubusercontent.com/u/327199?v=3","gravatar_id":"","url":"https://api.github.com/users/c089","html_url":"https://github.com/c089","followers_url":"https://api.github.com/users/c089/followers","following_url":"https://api.github.com/users/c089/following{/other_user}","gists_url":"https://api.github.com/users/c089/gists{/gist_id}","starred_url":"https://api.github.com/users/c089/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c089/subscriptions","organizations_url":"https://api.github.com/users/c089/orgs","repos_url":"https://api.github.com/users/c089/repos","events_url":"https://api.github.com/users/c089/events{/privacy}","received_events_url":"https://api.github.com/users/c089/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":51,"created_at":"2016-11-30T16:37:54Z","updated_at":"2016-12-04T13:19:37Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/softwerkskammer/Agora/pulls/1190","html_url":"https://github.com/softwerkskammer/Agora/pull/1190","diff_url":"https://github.com/softwerkskammer/Agora/pull/1190.diff","patch_url":"https://github.com/softwerkskammer/Agora/pull/1190.patch"},"body":"This PR:\r\n\r\n* [X] renames `testWithDB` to a more generic `testIntegration` folder which should hold all tests that are not true, independent unit tests\r\n* [X] merges `testApp` into `testIntegration` to reduce duplication in grunt configuration without obvious benefit\r\n* [X] starts moving integrated tests from `test` to `testIntegration`. For now this only moves the ones that always failed when external dependencies were missing or no network connection available. There are still some slow tests left\r\n* [X] refactors some tests to trust the contract established by existing integration tests, making them true unit tests\r\n\r\n\r\nFuture Work that I consider out of scope for this PR: \r\n* finish moving all slow tests to testIntegration or refactor to true unit tests so that unit test timeout can be reduced to 100ms\r\n* refactor some services to adhere to the SRP (e.g. extract file system concerns from members service) so they can be unit tested\r\n* improve integration tests for image processing by throwing a friendlier error (\"you need to install imagemagick\" instead of a \"ENOENT\")"},"comment":{"url":"https://api.github.com/repos/softwerkskammer/Agora/issues/comments/264703541","html_url":"https://github.com/softwerkskammer/Agora/pull/1190#issuecomment-264703541","issue_url":"https://api.github.com/repos/softwerkskammer/Agora/issues/1190","id":264703541,"user":{"login":"c089","id":327199,"avatar_url":"https://avatars.githubusercontent.com/u/327199?v=3","gravatar_id":"","url":"https://api.github.com/users/c089","html_url":"https://github.com/c089","followers_url":"https://api.github.com/users/c089/followers","following_url":"https://api.github.com/users/c089/following{/other_user}","gists_url":"https://api.github.com/users/c089/gists{/gist_id}","starred_url":"https://api.github.com/users/c089/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/c089/subscriptions","organizations_url":"https://api.github.com/users/c089/orgs","repos_url":"https://api.github.com/users/c089/repos","events_url":"https://api.github.com/users/c089/events{/privacy}","received_events_url":"https://api.github.com/users/c089/received_events","type":"User","site_admin":false},"created_at":"2016-12-04T13:19:37Z","updated_at":"2016-12-04T13:19:37Z","body":"```\r\n'use strict';\r\n\r\nconst expect = require('must-dist');\r\nconst CoolBeans = require('CoolBeans');\r\n\r\ndescribe.only('configureForTest issue', () => {\r\n  it('allows to configure different beans per test', () => {\r\n      const moduleName = 'membersPersistence';\r\n      const beans1a = require('../../testutil/configureForTest').get('beans');\r\n      const beans2 = require('../../testutil/configureForTestWithDB').get('beans');\r\n      const beans1b = require('../../testutil/configureForTest').get('beans');\r\n      const module1a = beans1a.get(moduleName);\r\n      const module2 = beans2.get(moduleName);\r\n      const module1b = beans1b.get(moduleName);\r\n      expect(module1a).to.not.be(module2);\r\n      expect(module1b).to.not.be(module2);\r\n  });\r\n\r\n  it('is not caused by underlying beans library',  () => {\r\n      const moduleName = 'membersPersistence';\r\n      const beans1a = new CoolBeans({[moduleName]: '1a'});\r\n      const beans1b = new CoolBeans({[moduleName]: '2'});\r\n      const beans2 = new CoolBeans({[moduleName]: '1b'});\r\n      const module1a = beans1a.get(moduleName);\r\n      const module2 = beans2.get(moduleName);\r\n      const module1b = beans1b.get(moduleName);\r\n      expect(module1a).to.not.be(module2);\r\n      expect(module1b).to.not.be(module2);\r\n  });\r\n});\r\n```\r\n\r\nDer zweite is grün."}}
{"actor":{"display_login":"c089"}}