Glimpse / Glimpse.Prototype

Glimpse v2 prototype
MIT License
185 stars 42 forks source link

Test project setup #17

Open nikmd23 opened 9 years ago

nikmd23 commented 9 years ago

Unit/Integration Testing:

Till now we have ben prototyping what Glimpse v2 would look like and have been avoiding writing unit tests. This is primarily because we have been making big changes and generally trying different concepts, hence ease of making changes has been a bigger priority over reliability. But now we are moving more towards locking down some of our concepts, setting up CI, brining more people into the project, etc and as such need to get tests in place.

Tasks This issue does not require more than a few tests being written. It's aim is not to improve test coverage, but rather put in place the infrastructure required to allow tests to be written:

We have various extensibility points that we are working on for Glimpse - part of the concept of Glimpse as a platform. We have been bitten in the past by not implementing enough concrete examples/implementations on top of these, that we found issues when people started to really build out on top of them. These involves both client and server side work and can priorities these as we go along. The benefit of this work is that it will actually help plugin authors with real code they can look at, additionally it can help drive the documentation.

nikmd23 commented 9 years ago

Update/Work in progress: Welp, the state of testing in .NET kind of sucks right now.

Testing Framework

@xunit added support for Beta 6 today, but we are already on Beta 7. @bradwilson has started a branch to get Beta 7 support up and running, but due to problems with Beta 7, it doesn't appear to be working. We may need to revisit this one in a few weeks.

Mocking Framework

I should have realized this sooner, but currently there are no mocking frameworks that support CoreCLR. (Including @nsubstitute.) Not all tests will need/require mocks though. We could either:

Edit: It looks like NSubstitute might be getting closer to a version that runs on core.

Auto Mocking

Clearly we can't use @AutoFixture or auto-mocking if we can't use mocking in general. AutoFixture does do more than just auto mocking, but we'll have to determine if there's enough value without being coupled to a mocking framework.

Resolution

Wait until @xunit supports Beta 7, and then revisit.

bradwilson commented 9 years ago

Only support running our tests on Windows. :disappointed: This makes me sad.

dnx451 works on Mono.

avanderhoorn commented 9 years ago

Not that this really helps, but I wonder if with the advent of the pre-compiler hooks, we will see mocking frameworks tapping into this to create their proxies at compile time... have to think about that one @davidfowl @anurse @lodejard

nikmd23 commented 9 years ago

That's true @bradwilson, thanks for reminding me.

bradwilson commented 9 years ago

Clearly someone is going to need to step up and fix Castle Proxy, because everybody is using the same engine. One fix could fix them all. :-p

nikmd23 commented 9 years ago

And that work is already well underway. :smile:

jonorossi commented 9 years ago

@bradwilson :wink: I've been working there slowly. xUnit,net is actually the thing currently blocking me at the moment https://github.com/castleproject/Core/issues/90#issuecomment-128287533.

avanderhoorn commented 9 years ago

As an update to this... I just brought over the work that @rynowak did which sets up the ground work for our integration tests.