-
Notifications
You must be signed in to change notification settings - Fork 19
Reporting #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reporting #21
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Record of all reports which have run, this will basically cause say an HTML report to be regenerated each time a new convention test is run. By keeping this list, we can just add to it, then pass the collection to the html renderer
…tted in a single file
So I finally got around to looking through the PR (sorry it took so long). I like the behaviour of it. I'm wondering though, if we're not trying to bite off too much in the initial run. Let me try spiking something to see if I can keeping it a bit more isolated from the core convention validation logic |
The conventions are actually simpler, before the report formatting lived in the convention, now it lives in the data class which makes more sense, as there will be more data than conventions so we do not have do duplicate that formatting logic as much Most of the complexity came from supporting symmetric conventions |
yeah I agree that formatting in conventions is less than optimal. I think it should be taken out of both convention and data into another abstraction(s). Have a look at #23 I added two new abstractions, one for splitting the data, and the other for putting it in the desired format. This is just the first iteration (don't merge the PR just yet) to get some feedback. Nice thing about it IMO is, it won't require any new interfaces or complication to data/convention classes. Let me know what you think. |
One thing I liked about the reporting changes is that ConventionResult went away. I think that is a good thing, as it allowed conventions to simply return failures and you don't lose that granularity. I might steal an idea or two from this, and apply it to my PR to simplify things. Thinking about Convention.Formatters, which will be a collection of formatters. Your PR cannot handle formatting of Projects/Project etc yet, so not sure where that would live |
Updated the PR, this puts IConventionData back the way it was, same with IConvention (apart from the Title and Description properties) |
Nice. I like where this is going. It looks much simpler now. I'm not sold on getting rid of
We ended up shifting a bunch of what it used to do to I'd be in favour of bringing it back. |
Actually, the reason I removed it was because of symmetric conventions. Because essentially you have two results shoved into one. The other option was IConvention.Execute returns |
Yes, you have two results in one, but this fact would be encapsulated by the ConventionResult itself. In the end, you still do that in a single test, so it's a single pass/failure. For reporting purposes you could have that done in two sections by encapsulating it nicely in a |
I actually prefer it without it. I found it got in the way, and the call to ConventionResult.For could be replaced by returning a list of failures, and exposing a title property. It probably could be re-introduced now things have stabilised in the reporting. Did you want to have a go (so you can get a better feel for how it impacts the code). |
Also, by encapsulating it in the convention result, I found there was logic elsewhere which switched on something like IsSymmetric result. Or, ConventionResult contains possibly multiple results. Introducing the interface for Symmetric Convention felt nicer (I played with a few of these options while doing the reporting stuff) |
So the first part of your last message suggests you're against |
I don't mind seeing what introducing it does, but atm I don't think it is worth it Happy to see the result though, as you might have better ideas how to solve that issue |
ok, let's merge this PR and I'll see where I can take it next. I'm not sold that having |
Symmetric Test with approved exceptions:

Normal convention with approved exceptions

Failed convention

Only text reporting is available at the moment, but it is pluggable, and wanted to get feedback on many of the changes before writing more renderers
Also, I hate the naming on some of the interfaces. But can fix that later