Sunday, 2 June 2013

6.0.3 - Tests III

Yay, 840 tests are passing...

Let,s look at the highlights for the passing tests:

  • Majority of pass results due to test set-up changes - in particular the Mysql db set-up.

  • The stock NUnit dll pulled in by NuGet Restore (2.6.2) has isues in mono, and the NUnit introspection code will not work. Resolved by using NUnit 2.6.1 from ArchLinux AUR (required edit of AUR package file). NuGet 2.6.1 should work, but I have not tried it.

  • Routing...

    Does not appear to work. Replaced with:
    for (var i = RouteTable.Routes.Count - 1; i > -1; i--)

  • DbProvider issue...

    Goes to the machine.config file - so the dbProvider must exist there. Resolved by adding the MySql dbProvider to machine.config. Cause: This is b/c in tests HttpRequest is not defined and in mono this leads to a loss of the path (GetCurrentPath) to the nunit test config file.

  • Case insensitive Linq style query tests, e.g. (...).level will fail because the existing 'rescue' code fails in mono. To fix this I added:

    namespace Umbraco.Core.MultiPlatform
    public class ReflectionHelper
    public static BindingFlags GetBindingFlagsCasingSafe(BindingFlags bindingFlags)
    if (PlatformHelper.IsMono)
    return bindingFlags | BindingFlags.IgnoreCase;

    return bindingFlags;

And, let's look at the highlights for the failing tests:

  • Majority in Persistence.Repositories and Service.ContentService tests - may be due to database set-up issues.

  • PartialTrust...WhenMethodShouldNotSucceed - fail due to CAS implementation issues in mono.

  • String Extension Tests - encrypt / decrypt fail b/c of mono implementation differences. In particular, the HttpRuntime class is implemented very differently in mono, and I have not yet found a way to mock it. The encryption code leads to a direct call involving the HttpRuntime, and fails whenAppDomainVirtualPath is null. Easiest way to fix this would be to wrap the encryption code to make it mockable. In particular,

No comments:

Post a Comment

Note: only a member of this blog may post a comment.