{"action":"created","issue":{"url":"https://api.github.com/repos/bodil/purescript-test-unit/issues/21","repository_url":"https://api.github.com/repos/bodil/purescript-test-unit","labels_url":"https://api.github.com/repos/bodil/purescript-test-unit/issues/21/labels{/name}","comments_url":"https://api.github.com/repos/bodil/purescript-test-unit/issues/21/comments","events_url":"https://api.github.com/repos/bodil/purescript-test-unit/issues/21/events","html_url":"https://github.com/bodil/purescript-test-unit/issues/21","id":164688927,"number":21,"title":"Tests run 3 times - expected behavior?","user":{"login":"adarqui","id":1018013,"avatar_url":"https://avatars.githubusercontent.com/u/1018013?v=3","gravatar_id":"","url":"https://api.github.com/users/adarqui","html_url":"https://github.com/adarqui","followers_url":"https://api.github.com/users/adarqui/followers","following_url":"https://api.github.com/users/adarqui/following{/other_user}","gists_url":"https://api.github.com/users/adarqui/gists{/gist_id}","starred_url":"https://api.github.com/users/adarqui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adarqui/subscriptions","organizations_url":"https://api.github.com/users/adarqui/orgs","repos_url":"https://api.github.com/users/adarqui/repos","events_url":"https://api.github.com/users/adarqui/events{/privacy}","received_events_url":"https://api.github.com/users/adarqui/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-07-09T22:35:54Z","updated_at":"2016-07-10T04:56:22Z","closed_at":null,"body":"Hi Bodil!\r\n\r\nI'm experiencing some weird behavior using purescript-test-unit. Here's the code:\r\n\r\nhttps://github.com/adarqui/cardiac-arrest/blob/master/experiments/parsing/big-strings/purescript/purescript-string-parsers/test/Main.purs\r\n\r\n```\r\ntest \"testing big strings\" do\r\n      void $ for (1..10) $ \\n -> do\r\n        makeAff $ \\_ succeed -> (print $ \"\\x2192 Testing string of size: \" <> show (1024 * n) <> \"\\n\") *> succeed unit\r\n        Assert.equal (Right $ bigString n) (runParser (string (bigString n)) (bigString n))\r\n```\r\n\r\nHere is the output:\r\n\r\n```\r\n* Build successful.\r\n* Running tests...\r\n→ Testing string of size: 1024\r\n→ Testing string of size: 2048\r\n→ Testing string of size: 3072\r\n→ Testing string of size: 4096\r\n→ Testing string of size: 5120\r\n→ Testing string of size: 6144\r\n→ Testing string of size: 7168\r\n→ Testing string of size: 8192\r\n→ Testing string of size: 9216\r\n→ Testing string of size: 10240\r\n→ Testing string of size: 1024\r\n→ Testing string of size: 2048\r\n→ Testing string of size: 3072\r\n→ Testing string of size: 4096\r\n→ Testing string of size: 5120\r\n→ Testing string of size: 6144\r\n→ Testing string of size: 7168\r\n→ Testing string of size: 8192\r\n→ Testing string of size: 9216\r\n→ Testing string of size: 10240\r\n→ Testing string of size: 1024\r\n→ Testing string of size: 2048\r\n→ Testing string of size: 3072\r\n→ Testing string of size: 4096\r\n→ Testing string of size: 5120\r\n→ Testing string of size: 6144\r\n→ Testing string of size: 7168\r\n→ Testing string of size: 8192\r\n→ Testing string of size: 9216\r\n→ Testing string of size: 10240\r\n* Tests OK.\r\n```\r\n\r\n\r\nHere is what I'd expect to see:\r\n\r\n```\r\n* Build successful.\r\n* Running tests...\r\n→ Testing string of size: 1024\r\n→ Testing string of size: 2048\r\n→ Testing string of size: 3072\r\n→ Testing string of size: 4096\r\n→ Testing string of size: 5120\r\n→ Testing string of size: 6144\r\n→ Testing string of size: 7168\r\n→ Testing string of size: 8192\r\n→ Testing string of size: 9216\r\n→ Testing string of size: 10240\r\n* Tests OK.\r\n```\r\n\r\n\r\nAny idea? Or is this to be expected? I haven't seen this behavior previously.\r\n\r\nThanks alot!"},"comment":{"url":"https://api.github.com/repos/bodil/purescript-test-unit/issues/comments/231570840","html_url":"https://github.com/bodil/purescript-test-unit/issues/21#issuecomment-231570840","issue_url":"https://api.github.com/repos/bodil/purescript-test-unit/issues/21","id":231570840,"user":{"login":"adarqui","id":1018013,"avatar_url":"https://avatars.githubusercontent.com/u/1018013?v=3","gravatar_id":"","url":"https://api.github.com/users/adarqui","html_url":"https://github.com/adarqui","followers_url":"https://api.github.com/users/adarqui/followers","following_url":"https://api.github.com/users/adarqui/following{/other_user}","gists_url":"https://api.github.com/users/adarqui/gists{/gist_id}","starred_url":"https://api.github.com/users/adarqui/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adarqui/subscriptions","organizations_url":"https://api.github.com/users/adarqui/orgs","repos_url":"https://api.github.com/users/adarqui/repos","events_url":"https://api.github.com/users/adarqui/events{/privacy}","received_events_url":"https://api.github.com/users/adarqui/received_events","type":"User","site_admin":false},"created_at":"2016-07-10T04:56:22Z","updated_at":"2016-07-10T04:56:22Z","body":"Hi Bodil,\r\n\r\nI think it runs things three times because:\r\n```\r\nrunTest ->\r\n             runTestWith -> Fancy.runTest ->\r\n                                                             printLive -> runSuiteItem (TestUnit ..) -> ... attempt\r\n                                                             printErrors -> collectErrors -> collectResults -> ... attempt\r\n             collectErrors -> collectResults -> ... attempt\r\n```\r\n\r\nso.. no matter what, it seems purescript-test-unit will run everything \"inside\" of a \"test\" block, 3 times? does the above code \"breakdown\" make sense? That's what i've gathered from following everything and dropping Debug.Trace.spy's everywhere.\r\n\r\nI noticed this because i'm creating some benchmarks for various purescript parsers - and every time i benchmark using pulp test, my results are for \"running everything 3 times\" instead of once.\r\n\r\nI personally have no idea how to fix the issue, otherwise I would attempt to PR. I mean it almost seems like there would need to be some kind of State or something, so that subsequent \"checks\" for the results of testing, can just be looked up instead of re-run. That's the only thing I can think of. But you and others would know better.\r\n\r\nHope that is of some help.\r\n\r\nThanks!"}}
{"actor":{"display_login":"adarqui"}}