CI with auto-deploy and Orchard

Topics: Administration, Core, General, Installing Orchard, Troubleshooting
Jan 2, 2012 at 9:02 AM

I've tried many and many hours making this happens. I want to make my build server, TeamCity in my case, compiles/build my Orchard instance, run all system and custom tests, then auto-deploy to a dev server then to a prod server.

I managed to compile, but the test phase, I configured TeamCity to use NUnit 2.5.2, always fails, and gave me the following important messages:

 

[10:38:24]: Orchard.Core.Tests.dll (27s)
[10:38:45]: [Orchard.Core.Tests.dll] Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GeneratedSlugInConflictInSameContaierPathIsVersioned
[10:38:45]: [Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GeneratedSlugInConflictInSameContaierPathIsVersioned] Test(s) failed.   Expected string length 9 but was 7. Strings differ at index 7.
  Expected: "bar/foo-2"
  But was:  "bar/foo"
  ------------------^
[10:38:45]: [Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GeneratedSlugInConflictInSameContaierPathIsVersioned] 
Test(s) failed.   Expected string length 9 but was 7. Strings differ at index 7.
  Expected: "bar/foo-2"
  But was:  "bar/foo"
  ------------------^

   at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
   at Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GeneratedSlugInConflictInSameContaierPathIsVersioned() in d:\Work\Mohamoon CMS\Mohamoon.CMS\src\Orchard.Core.Tests\Routable\Services\RoutableServiceTests.cs:line 195
[10:38:45]: [Orchard.Core.Tests.dll] Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GivenSlugInConflictInSameContaierPathIsVersioned
[10:38:46]: [Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GivenSlugInConflictInSameContaierPathIsVersioned] Test(s) failed.   Expected string length 9 but was 7. Strings differ at index 7.
  Expected: "bar/foo-2"
  But was:  "bar/foo"
  ------------------^
[10:38:46]: [Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GivenSlugInConflictInSameContaierPathIsVersioned] 
Test(s) failed.   Expected string length 9 but was 7. Strings differ at index 7.
  Expected: "bar/foo-2"
  But was:  "bar/foo"
  ------------------^

   at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
   at Orchard.Core.Tests.Routable.Services.RoutableServiceTests.GivenSlugInConflictInSameContaierPathIsVersioned() in d:\Work\Mohamoon CMS\Mohamoon.CMS\src\Orchard.Core.Tests\Routable\Services\RoutableServiceTests.cs:line 203
[10:38:46]: [Orchard.Core.Tests.dll] Orchard.Core.Tests.Routable.Services.RoutableServiceTests.SlugInConflictWithAnExistingItemsPathIsVersioned
[10:38:47]: [Orchard.Core.Tests.Routable.Services.RoutableServiceTests.SlugInConflictWithAnExistingItemsPathIsVersioned] Test(s) failed.   Expected string length 9 but was 7. Strings differ at index 7.
  Expected: "foo/bar-2"
  But was:  "foo/bar"
  ------------------^
[10:38:47]: [Orchard.Core.Tests.Routable.Services.RoutableServiceTests.SlugInConflictWithAnExistingItemsPathIsVersioned] 
Test(s) failed.   Expected string length 9 but was 7. Strings differ at index 7.
  Expected: "foo/bar-2"
  But was:  "foo/bar"
  ------------------^

   at NUnit.Framework.Assert.That(Object actual, IResolveConstraint expression, String message, Object[] args)
[10:38:51]: Some test(s) failed in D:\Work\Mohamoon CMS\Mohamoon.CMS\buildartifacts\Orchard.Core.Tests.dll, tests run continued. Child test failed
[10:38:53]: Orchard.Framework.Tests.dll (41m:44s)
[11:20:35]: [Orchard.Framework.Tests.dll] Orchard.Tests.Tasks.SweepGeneratorTests.ActivatedEventShouldStartTimer
[11:20:36]: [Orchard.Tests.Tasks.SweepGeneratorTests.ActivatedEventShouldStartTimer] Test(s) failed. Moq.MockException : 
Expected invocation on the mock at least once, but was never performed: x => x.Sweep()
[11:20:36]: [Orchard.Tests.Tasks.SweepGeneratorTests.ActivatedEventShouldStartTimer] 
Test(s) failed. Moq.MockException : 
Expected invocation on the mock at least once, but was never performed: x => x.Sweep()
   at Moq.Mock.ThrowVerifyException(IProxyCall expected, Expression expression, Times times, Int32 callCount)
   at Moq.Mock`1.Verify(Expression`1 expression, Times times)
   at Orchard.Tests.Tasks.SweepGeneratorTests.ActivatedEventShouldStartTimer() in d:\Work\Mohamoon CMS\Mohamoon.CMS\src\Orchard.Tests\Tasks\SweepGeneratorTests.cs:line 40
[11:20:39]: Some test(s) failed in D:\Work\Mohamoon CMS\Mohamoon.CMS\buildartifacts\Orchard.Framework.Tests.dll, tests run continued. Child test failed

 

Also, I can't figure out how to make the whole auto-deploy especially there will be xcopy of modules.

Please I need help!!!

 

Jan 2, 2012 at 2:23 PM

It appears those tests are failing.  Either the tests are invalid or the code line you have actually has an error in that area of the code.

If you are not modifying the core and framework projects you maybe want to turn those tests off, or if you are going to maintain that area of code and contribute to the source, you might want to connect with one of the key contributors about the error and work with them to fix it.  By reading the test names it appears that the test is trying to confirm that if you attempt to create a second object with the same slug it should autorename the slug but it is not doing so.

Jan 2, 2012 at 5:03 PM
corecomps wrote:

It appears those tests are failing.  Either the tests are invalid or the code line you have actually has an error in that area of the code.

If you are not modifying the core and framework projects you maybe want to turn those tests off, or if you are going to maintain that area of code and contribute to the source, you might want to connect with one of the key contributors about the error and work with them to fix it.  By reading the test names it appears that the test is trying to confirm that if you attempt to create a second object with the same slug it should autorename the slug but it is not doing so.

Thanks for your reply, I didn't change the core nor the framework.

Also still need help for auto-deploy Orchard.

Coordinator
Jan 2, 2012 at 7:59 PM

Do those tests fail when you run them locally?

Jan 3, 2012 at 10:12 AM
Edited Jan 3, 2012 at 10:15 AM
bertrandleroy wrote:

Do those tests fail when you run them locally?

Yes, they do :(

Also still need help for auto-deploy Orchard.

Coordinator
Jan 3, 2012 at 4:40 PM

what version of Orchard are you trying to compile ? I assume the build server won't deploy if a step fails, in your case the tests.

Jan 3, 2012 at 4:53 PM
sebastienros wrote:

what version of Orchard are you trying to compile ? I assume the build server won't deploy if a step fails, in your case the tests.

The version is 1.3.9, and no, I didn't configure the build server to deploy upon tests success. All I seek for the auto-deploy is the command line to do the deploy of Orchard and its modules and themes, prefer to have the deploy only of compiled modules and themes.

Thanks guys for trying to help :)