{"action":"created","issue":{"url":"https://api.github.com/repos/spf13/hugo/issues/818","labels_url":"https://api.github.com/repos/spf13/hugo/issues/818/labels{/name}","comments_url":"https://api.github.com/repos/spf13/hugo/issues/818/comments","events_url":"https://api.github.com/repos/spf13/hugo/issues/818/events","html_url":"https://github.com/spf13/hugo/pull/818","id":55179647,"number":818,"title":"Expansion of unit tests for utils/utils.go","user":{"login":"owenwaller","id":1481655,"avatar_url":"https://avatars.githubusercontent.com/u/1481655?v=3","gravatar_id":"","url":"https://api.github.com/users/owenwaller","html_url":"https://github.com/owenwaller","followers_url":"https://api.github.com/users/owenwaller/followers","following_url":"https://api.github.com/users/owenwaller/following{/other_user}","gists_url":"https://api.github.com/users/owenwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/owenwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owenwaller/subscriptions","organizations_url":"https://api.github.com/users/owenwaller/orgs","repos_url":"https://api.github.com/users/owenwaller/repos","events_url":"https://api.github.com/users/owenwaller/events{/privacy}","received_events_url":"https://api.github.com/users/owenwaller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/spf13/hugo/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"owenwaller","id":1481655,"avatar_url":"https://avatars.githubusercontent.com/u/1481655?v=3","gravatar_id":"","url":"https://api.github.com/users/owenwaller","html_url":"https://github.com/owenwaller","followers_url":"https://api.github.com/users/owenwaller/followers","following_url":"https://api.github.com/users/owenwaller/following{/other_user}","gists_url":"https://api.github.com/users/owenwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/owenwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/owenwaller/subscriptions","organizations_url":"https://api.github.com/users/owenwaller/orgs","repos_url":"https://api.github.com/users/owenwaller/repos","events_url":"https://api.github.com/users/owenwaller/events{/privacy}","received_events_url":"https://api.github.com/users/owenwaller/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-01-22T17:05:16Z","updated_at":"2015-02-19T16:30:53Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/spf13/hugo/pulls/818","html_url":"https://github.com/spf13/hugo/pull/818","diff_url":"https://github.com/spf13/hugo/pull/818.diff","patch_url":"https://github.com/spf13/hugo/pull/818.patch"},"body":"This commit expands the test coverage for the utils/utils.go module.\r\n\r\nThe utils module uses the 'github.com/spf13/jwalterweatherman' (aka jww)\r\npackage for logging. The tests take the approach of examining the log\r\nfile that is produced by this module to verify correct behaviour. This\r\navoids refactoring the utils module.\r\n\r\nThe log file messages written by the jww module are of the form:\r\n<log level>: yyyy/mm/dd <string|error message>\r\n\r\nThe checkLogFile function checks each of these parts in turn except for\r\nthe date string, which is currently ignored. The final part of the log\r\nfile format can either be a single error message, or a series of\r\nstrings followed by an error message. Both the error message and the\r\nseries of strings can be empty strings.\r\n\r\nThe log file is checked using a combination of the regex package,\r\nalong with the bufio scanner type. Each test logs to its own temporary\r\nlog file. This is achieved with standard test setup and teardown\r\nfunctions.\r\n\r\nOne consequence of these tests is that StopOnErr has been refactored\r\ninto call a new unexported function doStopOnErr which contains the bulk\r\nof the original logic. This allows the same testing approach to be used\r\nwith StopOnErr as with CheckErr and cutUsageMessage, rather than look at\r\nthe exit status code of the test itself.\r\n\r\nAn unfortunate side effect of this is that the author of the tests must\r\nnow know if a log file is expected or not. If doStopOnErr determines\r\nthat an empty error message would be written to the log file then\r\nnothing is written. In the context of the tests this means that the log\r\nfile created by the test would have no contents. Consequently there\r\nwould be nothing for the test to examine. This situation is indicated by\r\nthe boolean flag logFileExoected in the testData struct, and processed\r\nby the logFileIsExpectedAndValid function.\r\n\r\nAlthough not ideal this was deemed a reasonable compromise."},"comment":{"url":"https://api.github.com/repos/spf13/hugo/issues/comments/75083928","html_url":"https://github.com/spf13/hugo/pull/818#issuecomment-75083928","issue_url":"https://api.github.com/repos/spf13/hugo/issues/818","id":75083928,"user":{"login":"spf13","id":173412,"avatar_url":"https://avatars.githubusercontent.com/u/173412?v=3","gravatar_id":"","url":"https://api.github.com/users/spf13","html_url":"https://github.com/spf13","followers_url":"https://api.github.com/users/spf13/followers","following_url":"https://api.github.com/users/spf13/following{/other_user}","gists_url":"https://api.github.com/users/spf13/gists{/gist_id}","starred_url":"https://api.github.com/users/spf13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spf13/subscriptions","organizations_url":"https://api.github.com/users/spf13/orgs","repos_url":"https://api.github.com/users/spf13/repos","events_url":"https://api.github.com/users/spf13/events{/privacy}","received_events_url":"https://api.github.com/users/spf13/received_events","type":"User","site_admin":false},"created_at":"2015-02-19T16:30:53Z","updated_at":"2015-02-19T16:30:53Z","body":"I'm looking into this now. I'll try to share with you what I have. \n\nBest,\nSteve\n\n-- \nSteve Francia\nhttp://stevefrancia.com\nhttp://spf13.com\nhttp://twitter.com/spf13\n\n\nOn February 19, 2015 at 8:22:14 AM, Owen Waller (notifications@github.com) wrote:\n\n@anthonyfok @bep @spf13\n\nFolks in order to take a look at this, I've set-up an account on AppVeyor and am trying building the current master branch via AppVeyor. So my last commit is: a389268.\n\nHaving not used AppVeyor before this seems the simplest test I could do, since the master branch should be golden...\n\nBut it's not building - See:https://ci.appveyor.com/project/owenwaller/hugo/build/1.0.23 for my latest attempt.\n\nAlso AppVoyer is using go 1.3 wndows/amd64 as you can see from the build output, though I am not sure this is any effect. But I'm using go 1.4.1 locally on Linux and I don't have a problem building this branch.\n\nSo can anyone spot anything that I might have missed?\n\n@spf13 Steve can you send me a copy of you AppVeyor settings so I can be sure that I have the same settings as a the build node you are using? Or create an Appveyor.yml and share that.\n\nBut at the minute until I get the current master branch to build I'm a bit stuck :(. My plan is then to rebase my original pull request on the latest master and see if I can reproduce the issue.\n\n(I see similar behaviour is I try to build my original utils-test-code that contained the original pull request. So this looks like a Windows/AppVeyor only thing at the minute)\n\nAny help at this stage would be much appreciated.\n\nOwen\n\n—\nReply to this email directly or view it on GitHub.\n\n"}}