{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/15211","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/15211/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/15211/comments","events_url":"https://api.github.com/repos/golang/go/issues/15211/events","html_url":"https://github.com/golang/go/issues/15211","id":147133031,"number":15211,"title":"proposal: test: indicate when no tests match -run","user":{"login":"cmarcelo","id":10478,"avatar_url":"https://avatars.githubusercontent.com/u/10478?v=3","gravatar_id":"","url":"https://api.github.com/users/cmarcelo","html_url":"https://github.com/cmarcelo","followers_url":"https://api.github.com/users/cmarcelo/followers","following_url":"https://api.github.com/users/cmarcelo/following{/other_user}","gists_url":"https://api.github.com/users/cmarcelo/gists{/gist_id}","starred_url":"https://api.github.com/users/cmarcelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmarcelo/subscriptions","organizations_url":"https://api.github.com/users/cmarcelo/orgs","repos_url":"https://api.github.com/users/cmarcelo/repos","events_url":"https://api.github.com/users/cmarcelo/events{/privacy}","received_events_url":"https://api.github.com/users/cmarcelo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/Proposal","name":"Proposal","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/6","html_url":"https://github.com/golang/go/milestones/Unplanned","labels_url":"https://api.github.com/repos/golang/go/milestones/6/labels","id":1055141,"number":6,"title":"Unplanned","description":"No plan to fix in any specific release.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":1255,"closed_issues":331,"state":"open","created_at":"2015-04-06T20:47:19Z","updated_at":"2016-04-09T16:35:33Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":3,"created_at":"2016-04-09T14:29:10Z","updated_at":"2016-04-09T20:18:12Z","closed_at":null,"body":"When using `go test -run` to filter tests, there's no clear indication when no tests match. The proposal is to change testing and test package to provide and display this information.\r\n\r\nExamples:\r\n\r\n```\r\n$ go test -run DontMatchAnything\r\ntesting: warning: no tests match regexp: DontMatchAnything      # 1\r\nPASS\r\n?   \t_/tmp\t[no tests match regexp]                         # 2\r\n\r\n$ go test -run DontMatchAnything testing/...\r\n?   \ttesting\t[no tests match regexp]\r\n?   \ttesting/iotest\t[no test files]\r\n?   \ttesting/quick\t[no tests match regexp]\r\n\r\n$ go test -run Mutually testing/...       # Test matches in testing/quick\r\n?   \ttesting\t[no tests match regexp]\r\n?   \ttesting/iotest\t[no test files]\r\nok  \ttesting/quick\t0.004s\r\n```\r\n\r\nIn all cases the exit code would remaing 0, as it would be without the proposal.\r\n\r\nThe testing package would output the line indicated by (1) and the go test, instead of \"ok ...\" would output \"? ...\" for the package, like in the line indicated by (2), in the same style as when there are no test files.\r\n\r\nWhile it's possible to use -v and inspect whether tests were ran or not, it's easy to get confused as the output for not matching anything (with verbose) is identical to output of matching without verbose.\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/207848056","html_url":"https://github.com/golang/go/issues/15211#issuecomment-207848056","issue_url":"https://api.github.com/repos/golang/go/issues/15211","id":207848056,"user":{"login":"martisch","id":184995,"avatar_url":"https://avatars.githubusercontent.com/u/184995?v=3","gravatar_id":"","url":"https://api.github.com/users/martisch","html_url":"https://github.com/martisch","followers_url":"https://api.github.com/users/martisch/followers","following_url":"https://api.github.com/users/martisch/following{/other_user}","gists_url":"https://api.github.com/users/martisch/gists{/gist_id}","starred_url":"https://api.github.com/users/martisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martisch/subscriptions","organizations_url":"https://api.github.com/users/martisch/orgs","repos_url":"https://api.github.com/users/martisch/repos","events_url":"https://api.github.com/users/martisch/events{/privacy}","received_events_url":"https://api.github.com/users/martisch/received_events","type":"User","site_admin":false},"created_at":"2016-04-09T20:18:12Z","updated_at":"2016-04-09T20:18:12Z","body":"Note that for benchmarks (when -bench is specified too) sometimes it might not desired to run tests again and again. So maybe no warning when -bench matches or when -run=^$ is specified. But i guess if no existing commonly used benchmark analyses tools get confused by the additional output it will be fine too."}}