test(850): add tests for git-bug comment edit has no effect#855
test(850): add tests for git-bug comment edit has no effect#855
git-bug comment edit has no effect#855Conversation
Reminds me, I think your previous PR had some logging as well. Should we remove those? It makes the test output a bit hard to parse. |
The tests do indeed result in output to Ignoring the extra logging I mentioned above and the failed test's output, running the CLI tests results in output like this: Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.
Building identity cache... Done.
Building bug cache... Done.Every time I add a test, there are two more lines and so it's been getting more annoying as more of the CLI has test coverage. I haven't really started covering the error paths yet! A couple days ago, I created #849 to address this in the "core" - that will result quiet (passing) tests when there's a failure or when the |
Now that I am on a computer ... I was actually thinking about this one: https://github.com/MichaelMure/git-bug/blob/master/commands/ls_test.go#L80 Regarding this specific issue, it might be something I noticed a while back in #664 but hasn't been merged yet: https://github.com/MichaelMure/git-bug/pull/664/files?show-deleted-files=true&show-viewed-files=true&file-filters%5B%5D=#diff-8ad691e03338c49c8ea10285bf2a59172fc5b230f161292b92931a66c06b5f6aR275-R282 I don't remember exactly why I made that change, but it looks like the combined Id need to be resolved to a comment/operation Id first. If the Id is incorrect, the operation will silently do nothing when applying as it's considered invalid. |
|
Ugh ... you're right! That logging should have been removed but since it's a |
|
From what you've described, I think the following code (to be removed from the test) should be working: // TODO: remove this comment and everything between the "snip"
// comments when issue #850 is resolved.
// ***** snip *****
cache, err := env.env.backend.ResolveBugPrefix(bugID)
require.NoError(t, err)
bu, err := bug.Read(env.env.repo, cache.Id())
require.NoError(t, err)
for _, op := range bu.Operations() {
t.Log("Operation: ", op)
}
t.Log("Compiled comments: ", bu.Compile().Comments)
// ***** snip *****Let me know if you see something that could be improved for debugging purposes! |
git-bug comment edit has no effectgit-bug comment edit has no effect
|
@MichaelMure - The problem described in #850 ( |
This PR continues the work of adding unit tests to the CLI commands with the aim of solving the issue with the
git-bug comment editcommand not being recognized (#850). These tests have a bit of logging that should be removed before this PR is merged.