{"action":"created","issue":{"url":"https://api.github.com/repos/CityOfZion/neo-python/issues/478","repository_url":"https://api.github.com/repos/CityOfZion/neo-python","labels_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/478/labels{/name}","comments_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/478/comments","events_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/478/events","html_url":"https://github.com/CityOfZion/neo-python/issues/478","id":335821877,"node_id":"MDU6SXNzdWUzMzU4MjE4Nzc=","number":478,"title":"Reduce test fixtures size to speed up tests","user":{"login":"ixje","id":6625537,"node_id":"MDQ6VXNlcjY2MjU1Mzc=","avatar_url":"https://avatars0.githubusercontent.com/u/6625537?v=4","gravatar_id":"","url":"https://api.github.com/users/ixje","html_url":"https://github.com/ixje","followers_url":"https://api.github.com/users/ixje/followers","following_url":"https://api.github.com/users/ixje/following{/other_user}","gists_url":"https://api.github.com/users/ixje/gists{/gist_id}","starred_url":"https://api.github.com/users/ixje/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixje/subscriptions","organizations_url":"https://api.github.com/users/ixje/orgs","repos_url":"https://api.github.com/users/ixje/repos","events_url":"https://api.github.com/users/ixje/events{/privacy}","received_events_url":"https://api.github.com/users/ixje/received_events","type":"User","site_admin":false},"labels":[{"id":860789620,"node_id":"MDU6TGFiZWw4NjA3ODk2MjA=","url":"https://api.github.com/repos/CityOfZion/neo-python/labels/good%20beginner%20task","name":"good beginner task","color":"c2e0c6","default":false},{"id":648322779,"node_id":"MDU6TGFiZWw2NDgzMjI3Nzk=","url":"https://api.github.com/repos/CityOfZion/neo-python/labels/help%20wanted","name":"help wanted","color":"128A0C","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":89,"created_at":"2018-06-26T13:32:48Z","updated_at":"2018-09-16T00:13:24Z","closed_at":null,"author_association":"MEMBER","body":"### Current behavior\r\ntravis-ci takes > 15 minutes to run all tests. One reason is that the tests rely on a fixture database that's > 500MB in size. The fixture database is basically a zipped up testnet blockchain folder. This big size is the result of having testcases deployed on the regular TestNet, which then have many unnecessary blocks added to the fixtures in between different tests created on that network.\r\n\r\nWe believe that the fixture size can be easily reduced to < 50 MB by recreating all tests on a special private TestNet. This testnet should be based on [neo-privatenet-docker](https://github.com/CityOfZion/neo-privatenet-docker)\r\nThe image should only be spun up when adding new tests that requires events or interactions on a full blockchain (e.g. smart contract storage tests) to keep the database to the minimal size necessary.\r\n\r\nTODO:\r\n- [ ] create an inventory of all tests to be ported to the private testnet (hint: look at what derives from: [BlockchainFixtureTestCase](https://github.com/CityOfZion/neo-python/blob/master/neo/Utils/BlockchainFixtureTestCase.\r\n- [ ] migrate all tests to a new private testnet docker image (based on neo-privatenet-docker)\r\n- [ ] make testnet docker image publicly available\r\n- [ ] create new fixture file, get it on CoZ AWS (ask @localhuman), update all test cases."},"comment":{"url":"https://api.github.com/repos/CityOfZion/neo-python/issues/comments/421658880","html_url":"https://github.com/CityOfZion/neo-python/issues/478#issuecomment-421658880","issue_url":"https://api.github.com/repos/CityOfZion/neo-python/issues/478","id":421658880,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTY1ODg4MA==","user":{"login":"jseagrave21","id":40873301,"node_id":"MDQ6VXNlcjQwODczMzAx","avatar_url":"https://avatars0.githubusercontent.com/u/40873301?v=4","gravatar_id":"","url":"https://api.github.com/users/jseagrave21","html_url":"https://github.com/jseagrave21","followers_url":"https://api.github.com/users/jseagrave21/followers","following_url":"https://api.github.com/users/jseagrave21/following{/other_user}","gists_url":"https://api.github.com/users/jseagrave21/gists{/gist_id}","starred_url":"https://api.github.com/users/jseagrave21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jseagrave21/subscriptions","organizations_url":"https://api.github.com/users/jseagrave21/orgs","repos_url":"https://api.github.com/users/jseagrave21/repos","events_url":"https://api.github.com/users/jseagrave21/events{/privacy}","received_events_url":"https://api.github.com/users/jseagrave21/received_events","type":"User","site_admin":false},"created_at":"2018-09-16T00:13:24Z","updated_at":"2018-09-16T00:13:24Z","author_association":"CONTRIBUTOR","body":"For the other failures in test_json_rpc_api.py when running `make test` there must be something wrong with the way that `discover neo` is being implemented.\r\nFor example, here is one of the failures:\r\n```\r\nFAIL: test_block_non_verbose (api.JSONRPC.test_json_rpc_api.JsonRpcApiTestCase)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"/mnt/c/users/jseag/neo/neo-python-travis/neo/api/JSONRPC/test_json_rpc_api.py\", line 241, in test_block_non_verbose\r\n    self.assertEqual(block.Index, 2003)\r\nAssertionError: 2002 != 2003\r\n```\r\nYet, the block being queried in `test_json_rpc_api.py` is 2003:\r\n```\r\ndef test_block_non_verbose(self):\r\n        req = self._gen_rpc_req(\"getblock\", params=[2003, 0])\r\n        mock_req = mock_request(json.dumps(req).encode(\"utf-8\"))\r\n        res = json.loads(self.app.home(mock_req))\r\n        self.assertIsNotNone(res['result'])\r\n\r\n        # we should be able to instantiate a matching block with the result\r\n        output = binascii.unhexlify(res['result'])\r\n        block = Helper.AsSerializableWithType(output, 'neo.Core.Block.Block')\r\n        self.assertEqual(block.Index, 2003)\r\n        self.assertEqual(len(block.Transactions), 1)\r\n```\r\nSo, the `discover neo` is off by one block."}}
{"actor":{"display_login":"jseagrave21"}}