{"action":"created","issue":{"url":"https://api.github.com/repos/nose-devs/nose2/issues/398","repository_url":"https://api.github.com/repos/nose-devs/nose2","labels_url":"https://api.github.com/repos/nose-devs/nose2/issues/398/labels{/name}","comments_url":"https://api.github.com/repos/nose-devs/nose2/issues/398/comments","events_url":"https://api.github.com/repos/nose-devs/nose2/issues/398/events","html_url":"https://github.com/nose-devs/nose2/issues/398","id":325515221,"node_id":"MDU6SXNzdWUzMjU1MTUyMjE=","number":398,"title":"Plugins `junitxml` and `layers` don't seem to interact nicely.","user":{"login":"neilvyas","id":6266395,"node_id":"MDQ6VXNlcjYyNjYzOTU=","avatar_url":"https://avatars1.githubusercontent.com/u/6266395?v=4","gravatar_id":"","url":"https://api.github.com/users/neilvyas","html_url":"https://github.com/neilvyas","followers_url":"https://api.github.com/users/neilvyas/followers","following_url":"https://api.github.com/users/neilvyas/following{/other_user}","gists_url":"https://api.github.com/users/neilvyas/gists{/gist_id}","starred_url":"https://api.github.com/users/neilvyas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neilvyas/subscriptions","organizations_url":"https://api.github.com/users/neilvyas/orgs","repos_url":"https://api.github.com/users/neilvyas/repos","events_url":"https://api.github.com/users/neilvyas/events{/privacy}","received_events_url":"https://api.github.com/users/neilvyas/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-23T01:15:45Z","updated_at":"2018-06-05T21:14:59Z","closed_at":"2018-06-05T19:32:45Z","author_association":"NONE","body":"I have a set of tests with both the given plugins enabled.\r\n\r\nStarting yesterday, with no apparent updates of any code, I get the following error after every run of the whole test suite using `nose2 --config=setup.cfg ...`, whether the run was clean or not:\r\n\r\n```\r\nInternal Error: runTests aborted: 'LayerSuite' object has no attribute 'id'\r\n```\r\n\r\nI expected no error to be produced here, and the run to terminate successfully with an xml report.\r\n\r\n\r\nI have tried disabling `junitxml` and the run seems to succeed until another part of my test flow fails because no xml report was produced. If this ticket gains any traction, I will attempt to run it without expecting an xml report and without junitxml to see if I can get a clean run.\r\n\r\n\r\n\r\nI dug through the source for both plugins as well as `unittest.BaseTestSuite`, `unittest.TestSuite`, and `unittest.TestCase`, and my observations are:\r\n\r\n1. I think this error is being raised by the `junitxml` plugin, because\r\n    * it happens after all tests have been run, seemingly successfully;\r\n    * there is no xml report produced; and\r\n    * there is some suggestive code (detailed later).\r\n2. I think this error is raised [right here](https://github.com/nose-devs/nose2/blob/master/nose2/plugins/junitxml.py#L120-L121), because\r\n    * it's the only codepath I could find in the given packages that calls `test.id()`; and\r\n    * it operates on all `event.test`s with no filtering, which means it might be operating on layer objects.\r\n3. None of the `...Suite` classes define `id`, but `unittest.TestCase` does.\r\n\r\n\r\nSo, I think that we should guard the call to `id()` in `junitxml`'s source. It is somehow being called on a `LayerSuite` object instead of a `unittest.TestCase` object, which causes it to break, I think."},"comment":{"url":"https://api.github.com/repos/nose-devs/nose2/issues/comments/394862758","html_url":"https://github.com/nose-devs/nose2/issues/398#issuecomment-394862758","issue_url":"https://api.github.com/repos/nose-devs/nose2/issues/398","id":394862758,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDg2Mjc1OA==","user":{"login":"katrinabrock","id":16126168,"node_id":"MDQ6VXNlcjE2MTI2MTY4","avatar_url":"https://avatars3.githubusercontent.com/u/16126168?v=4","gravatar_id":"","url":"https://api.github.com/users/katrinabrock","html_url":"https://github.com/katrinabrock","followers_url":"https://api.github.com/users/katrinabrock/followers","following_url":"https://api.github.com/users/katrinabrock/following{/other_user}","gists_url":"https://api.github.com/users/katrinabrock/gists{/gist_id}","starred_url":"https://api.github.com/users/katrinabrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/katrinabrock/subscriptions","organizations_url":"https://api.github.com/users/katrinabrock/orgs","repos_url":"https://api.github.com/users/katrinabrock/repos","events_url":"https://api.github.com/users/katrinabrock/events{/privacy}","received_events_url":"https://api.github.com/users/katrinabrock/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T21:14:59Z","updated_at":"2018-06-05T21:14:59Z","author_association":"COLLABORATOR","body":"@neilvyas feel free to raise an issue about the your exception getting swallowed and reopen this one. If you can provide an example case to make that happen, all the better. "}}
{"actor":{"display_login":"katrinabrock"}}