{"action":"created","issue":{"url":"https://api.github.com/repos/invenia/Mocking.jl/issues/68","repository_url":"https://api.github.com/repos/invenia/Mocking.jl","labels_url":"https://api.github.com/repos/invenia/Mocking.jl/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/invenia/Mocking.jl/issues/68/comments","events_url":"https://api.github.com/repos/invenia/Mocking.jl/issues/68/events","html_url":"https://github.com/invenia/Mocking.jl/pull/68","id":485950105,"node_id":"MDExOlB1bGxSZXF1ZXN0MzExNDk4MTMw","number":68,"title":"Avoid requirement to disable compiled modules","user":{"login":"omus","id":1675958,"node_id":"MDQ6VXNlcjE2NzU5NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/1675958?v=4","gravatar_id":"","url":"https://api.github.com/users/omus","html_url":"https://github.com/omus","followers_url":"https://api.github.com/users/omus/followers","following_url":"https://api.github.com/users/omus/following{/other_user}","gists_url":"https://api.github.com/users/omus/gists{/gist_id}","starred_url":"https://api.github.com/users/omus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/omus/subscriptions","organizations_url":"https://api.github.com/users/omus/orgs","repos_url":"https://api.github.com/users/omus/repos","events_url":"https://api.github.com/users/omus/events{/privacy}","received_events_url":"https://api.github.com/users/omus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2019-08-27T17:56:40Z","updated_at":"2019-08-28T17:17:55Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/invenia/Mocking.jl/pulls/68","html_url":"https://github.com/invenia/Mocking.jl/pull/68","diff_url":"https://github.com/invenia/Mocking.jl/pull/68.diff","patch_url":"https://github.com/invenia/Mocking.jl/pull/68.patch"},"body":"With this change `@mock` is no longer a no-op when not testing. The advantage of this change is that it allows for the `@mock` hooks to be pre-compiled into the code which allows tests which use Mocking to make use of compiled modules. This does mean there is some slight overhead for introducing a `@mock` call but I've done tried to mitigate the cost of by introducing a global constant which eliminates most of the overhead.\r\n\r\nThis has a significant advantage for packages which contain multiple dependencies:\r\n```\r\n$ time julia --project=@. --color=yes -e 'using Pkg; Pkg.test()'  # Mocking 0.6\r\n   Testing X\r\n Resolving package versions...\r\n┌ Warning: Using experimental code which modifies jl_options global struct\r\n└ @ Mocking ~/.julia/dev/Mocking/src/options.jl:53\r\n...\r\nreal    4m3.779s\r\nuser    3m6.729s\r\nsys    0m5.553s\r\n\r\n$ time julia --project=@. --color=yes -e 'using Pkg; Pkg.test()'  # This PR\r\n   Testing X\r\n Resolving package versions...\r\n┌ Warning: `Mocking.enable` is no longer used and can be safely removed.\r\n│   caller = ip:0x0\r\n└ @ Core :-1\r\n...\r\nreal    1m32.550s\r\nuser    1m10.885s\r\nsys    0m2.022s\r\n```\r\n\r\nTODO:\r\n- [x] Timing information for the overhead for always having `@mock` calls present\r\n- [x] Update the README with the new way things work\r\n\r\nNote: Using Cassette instead of `@mock` is still a work in progress. That PR will be pushed shortly. Based upon my use of Cassette so far there are certain scenarios where we may still want to use `@mock` for improving test performance or mocking calls inside of async code.\r\n\r\nEDIT: With the latest revision `@mock` is optimized away to once again have zero-overhead"},"comment":{"url":"https://api.github.com/repos/invenia/Mocking.jl/issues/comments/525839535","html_url":"https://github.com/invenia/Mocking.jl/pull/68#issuecomment-525839535","issue_url":"https://api.github.com/repos/invenia/Mocking.jl/issues/68","id":525839535,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNTgzOTUzNQ==","user":{"login":"oxinabox","id":5127634,"node_id":"MDQ6VXNlcjUxMjc2MzQ=","avatar_url":"https://avatars0.githubusercontent.com/u/5127634?v=4","gravatar_id":"","url":"https://api.github.com/users/oxinabox","html_url":"https://github.com/oxinabox","followers_url":"https://api.github.com/users/oxinabox/followers","following_url":"https://api.github.com/users/oxinabox/following{/other_user}","gists_url":"https://api.github.com/users/oxinabox/gists{/gist_id}","starred_url":"https://api.github.com/users/oxinabox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxinabox/subscriptions","organizations_url":"https://api.github.com/users/oxinabox/orgs","repos_url":"https://api.github.com/users/oxinabox/repos","events_url":"https://api.github.com/users/oxinabox/events{/privacy}","received_events_url":"https://api.github.com/users/oxinabox/received_events","type":"User","site_admin":false},"created_at":"2019-08-28T17:17:55Z","updated_at":"2019-08-28T17:17:55Z","author_association":"NONE","body":"Will review tomorrow\r\n"}}
{"actor":{"display_login":"oxinabox"}}