{"action":"created","issue":{"url":"https://api.github.com/repos/dedis/cothority/issues/170","repository_url":"https://api.github.com/repos/dedis/cothority","labels_url":"https://api.github.com/repos/dedis/cothority/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/dedis/cothority/issues/170/comments","events_url":"https://api.github.com/repos/dedis/cothority/issues/170/events","html_url":"https://github.com/dedis/cothority/issues/170","id":127410912,"number":170,"title":"Use mocking for network connections","user":{"login":"Liamsi","id":7441766,"avatar_url":"https://avatars.githubusercontent.com/u/7441766?v=3","gravatar_id":"","url":"https://api.github.com/users/Liamsi","html_url":"https://github.com/Liamsi","followers_url":"https://api.github.com/users/Liamsi/followers","following_url":"https://api.github.com/users/Liamsi/following{/other_user}","gists_url":"https://api.github.com/users/Liamsi/gists{/gist_id}","starred_url":"https://api.github.com/users/Liamsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Liamsi/subscriptions","organizations_url":"https://api.github.com/users/Liamsi/orgs","repos_url":"https://api.github.com/users/Liamsi/repos","events_url":"https://api.github.com/users/Liamsi/events{/privacy}","received_events_url":"https://api.github.com/users/Liamsi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dedis/cothority/labels/feature","name":"feature","color":"84b6eb"},{"url":"https://api.github.com/repos/dedis/cothority/labels/refactoring","name":"refactoring","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-01-19T10:08:50Z","updated_at":"2016-08-08T06:44:17Z","closed_at":null,"body":"Currently, every unit test, that uses network communication also tests the whole network stack.  \r\nWe already spent a lot of time in trying to figure out, why tests run locally but fail on travis (see #162, #163, #157, etc). One simple solution to that would be to mock the network connection. We should just test if `Open()`, `Close()`, `Listen()`, etc. are called in an appropriate order.\r\nTasks:\r\n\r\n1) Either use an simple mocking framework (could be golangs [default mocking framework](https://github.com/golang/mock/tree/master/sample) ?) or write a Mock just for the networking layer\r\n2) Make some tests use the mocked network library (instead opening and closing ports on localhost), especially tests which open, close and re-open the same ports are good candidates (see: https://github.com/golang/go/issues/11872#issuecomment-126183460)"},"comment":{"url":"https://api.github.com/repos/dedis/cothority/issues/comments/238153931","html_url":"https://github.com/dedis/cothority/issues/170#issuecomment-238153931","issue_url":"https://api.github.com/repos/dedis/cothority/issues/170","id":238153931,"user":{"login":"ineiti","id":1545067,"avatar_url":"https://avatars.githubusercontent.com/u/1545067?v=3","gravatar_id":"","url":"https://api.github.com/users/ineiti","html_url":"https://github.com/ineiti","followers_url":"https://api.github.com/users/ineiti/followers","following_url":"https://api.github.com/users/ineiti/following{/other_user}","gists_url":"https://api.github.com/users/ineiti/gists{/gist_id}","starred_url":"https://api.github.com/users/ineiti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ineiti/subscriptions","organizations_url":"https://api.github.com/users/ineiti/orgs","repos_url":"https://api.github.com/users/ineiti/repos","events_url":"https://api.github.com/users/ineiti/events{/privacy}","received_events_url":"https://api.github.com/users/ineiti/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T06:44:17Z","updated_at":"2016-08-08T06:44:17Z","body":"I still think we're merely hiding problems of the network-stack by using mocking here. Our network-stack is broken, so if we put another layer on top of it, it is still broken."}}
{"actor":{"display_login":"ineiti"}}