Skip to content
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

Linux unit tests compatibility #304

Merged
merged 17 commits into from
Feb 18, 2021
Merged

Conversation

obones
Copy link
Contributor

@obones obones commented Jan 18, 2021

A few changes, where changes are grouped by commits to show what was required to get to the lowest possible failures.
With this (and changes in the project itself), I'm down to those:

 [exec] 1) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Config.ValidatingLoaderTest.ShouldBeAbleToLoadXmlWithDTD
 [exec]   p1 should have been found
 [exec]   Expected: not null
 [exec]   But was:  null
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Config.ValidatingLoaderTest.ShouldBeAbleToLoadXmlWithDTD () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 2) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Publishers.EmailPublisherTest.EmailMessageWithDetails
 [exec]   message does not contain modifications: <html><head><style>body, table, form, input, td, th, p, textarea, select
 [exec] {
 [exec]  font-family: verdana, helvetica, arial;
 [exec]  font-size: 11px;
 [exec] }
 [exec]
 [exec] a:hover { color:#FC0; }
 [exec]
 [exec] .main-panel { color:#FC0; }
 [exec]
 [exec] .link { color:#FFF; text-decoration:none; }
 [exec] .link-failed { color:#F30; text-decoration:none; }
 [exec] .buildresults-header { color: #FFF; font-weight: bold; }
 [exec] .buildresults-data { color: #9F3; }
 [exec] .buildresults-data-failed { color: #F30; }
 [exec]
 [exec] .stylesection { margin-left: 4px; }
 [exec] .header-title { font-size:12px; color:#000; font-weight:bold; padding-bottom:10pt; }
 [exec] .header-label { font-weight:bold; }
 [exec] .header-data { color:#000; }
 [exec] .header-data-error { color:#000; white-space:pre; }
 [exec]
 [exec] .section-table { margin-top:10px; }
 [exec] .sectionheader { background-color:#006; color:#FFF; }
 [exec] .section-data { font-size:9px; color:#000; }
 [exec] .section-oddrow { background-color:#F0F7FF; }
 [exec] .section-evenrow { background-color:#FFF; }
 [exec] .section-error { font-size:9px; color:#F30; white-space:pre; }
 [exec]
 [exec] .warning { color: darkorange; }
 [exec] .error { color:red }
 [exec] .pluginLinks { float:right; margin-top:10px; padding:10px; background-color:#000066; color:White }</style></head><body>CruiseControl.NET Build Results for project Project#9 (<a href="">web page</a>)<p></p><hr size="1" width="98%" align="left" color="#888888"/></body></html>
 [exec]   Expected: True
 [exec]   But was:  False
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Publishers.EmailPublisherTest.EmailMessageWithDetails () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 3) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Publishers.EmailPublisherTest.UnitTestResultsShouldBeIncludedInEmailMessageWhenIncludesDetailsIsTrue
 [exec]   message does not contain 'Tests run': <html><head><style>body, table, form, input, td, th, p, textarea, select
 [exec] {
 [exec]  font-family: verdana, helvetica, arial;
 [exec]  font-size: 11px;
 [exec] }
 [exec]
 [exec] a:hover { color:#FC0; }
 [exec]
 [exec] .main-panel { color:#FC0; }
 [exec]
 [exec] .link { color:#FFF; text-decoration:none; }
 [exec] .link-failed { color:#F30; text-decoration:none; }
 [exec] .buildresults-header { color: #FFF; font-weight: bold; }
 [exec] .buildresults-data { color: #9F3; }
 [exec] .buildresults-data-failed { color: #F30; }
 [exec]
 [exec] .stylesection { margin-left: 4px; }
 [exec] .header-title { font-size:12px; color:#000; font-weight:bold; padding-bottom:10pt; }
 [exec] .header-label { font-weight:bold; }
 [exec] .header-data { color:#000; }
 [exec] .header-data-error { color:#000; white-space:pre; }
 [exec]
 [exec] .section-table { margin-top:10px; }
 [exec] .sectionheader { background-color:#006; color:#FFF; }
 [exec] .section-data { font-size:9px; color:#000; }
 [exec] .section-oddrow { background-color:#F0F7FF; }
 [exec] .section-evenrow { background-color:#FFF; }
 [exec] .section-error { font-size:9px; color:#F30; white-space:pre; }
 [exec]
 [exec] .warning { color: darkorange; }
 [exec] .error { color:red }
 [exec] .pluginLinks { float:right; margin-top:10px; padding:10px; background-color:#000066; color:White }</style></head><body>CruiseControl.NET Build Results for project test (<a href="">web page</a>)<p></p><hr size="1" width="98%" align="left" color="#888888"/></body></html>
 [exec]   Expected: True
 [exec]   But was:  False
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Publishers.EmailPublisherTest.UnitTestResultsShouldBeIncludedInEmailMessageWhenIncludesDetailsIsTrue () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 4) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Publishers.EmailPublisherTest.VerifyEmailSubjectAndMessageForExceptionIntegrationResult
 [exec]   message does not contain exception result message: <html><head><style>body, table, form, input, td, th, p, textarea, select
 [exec] {
 [exec]  font-family: verdana, helvetica, arial;
 [exec]  font-size: 11px;
 [exec] }
 [exec]
 [exec] a:hover { color:#FC0; }
 [exec]
 [exec] .main-panel { color:#FC0; }
 [exec]
 [exec] .link { color:#FFF; text-decoration:none; }
 [exec] .link-failed { color:#F30; text-decoration:none; }
 [exec] .buildresults-header { color: #FFF; font-weight: bold; }
 [exec] .buildresults-data { color: #9F3; }
 [exec] .buildresults-data-failed { color: #F30; }
 [exec]
 [exec] .stylesection { margin-left: 4px; }
 [exec] .header-title { font-size:12px; color:#000; font-weight:bold; padding-bottom:10pt; }
 [exec] .header-label { font-weight:bold; }
 [exec] .header-data { color:#000; }
 [exec] .header-data-error { color:#000; white-space:pre; }
 [exec]
 [exec] .section-table { margin-top:10px; }
 [exec] .sectionheader { background-color:#006; color:#FFF; }
 [exec] .section-data { font-size:9px; color:#000; }
 [exec] .section-oddrow { background-color:#F0F7FF; }
 [exec] .section-evenrow { background-color:#FFF; }
 [exec] .section-error { font-size:9px; color:#F30; white-space:pre; }
 [exec]
 [exec] .warning { color: darkorange; }
 [exec] .error { color:red }
 [exec] .pluginLinks { float:right; margin-top:10px; padding:10px; background-color:#000066; color:White }</style></head><body>CruiseControl.NET Build Results for project Project#9 (<a href="">web page</a>)<p></p><hr size="1" width="98%" align="left" color="#888888"/></body></html>
 [exec]   Expected: True
 [exec]   But was:  False
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Publishers.EmailPublisherTest.VerifyEmailSubjectAndMessageForExceptionIntegrationResult () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 5) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Sourcecontrol.PvcsHistoryParserTest.ParseModifications
 [exec]   Arrays should have same length
 [exec]   Expected: 4
 [exec]   But was:  0
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.CustomAssertion.AssertEqualArrays (System.Array expected, System.Array actual) [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Sourcecontrol.PvcsHistoryParserTest.ParseModifications () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 6) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Util.LogFileTraceListenerTest.LoggingAnEntryShouldFlushLogFileIfAutoFlushIsEnabled
 [exec]   Search substring: doh! is not contained in target:
 [exec]   Expected: True
 [exec]   But was:  False
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.CustomAssertion.AssertContains (System.String search, System.String target) [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.LogFileTraceListenerTest.LoggingAnEntryShouldFlushLogFileIfAutoFlushIsEnabled () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 7) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Util.RegistryTest.GetLocalMachineSubKeyValue
 [exec]   #A1
 [exec]   Expected: not null
 [exec]   But was:  null
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.RegistryTest.GetLocalMachineSubKeyValue () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 8) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Util.WildCardPathTest.StringWithWildcardsInPathShouldUseFolderWildcardsAndSimpleWildcardForAFolderName
 [exec]   Expected: 3
 [exec]   But was:  9
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.WildCardPathTest.StringWithWildcardsInPathShouldUseFolderWildcardsAndSimpleWildcardForAFolderName () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 9) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Util.WildCardPathTest.StringWithWildcardsInPathShouldUseWildcardsFollowedByFolderNameSegment
 [exec]   Expected: 3
 [exec]   But was:  9
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.WildCardPathTest.StringWithWildcardsInPathShouldUseWildcardsFollowedByFolderNameSegment () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 10) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Util.WildCardPathTest.StringWithWildcardsInPathShouldUseWildcardsInTwoFolderSegments
 [exec]   Expected: 5
 [exec]   But was:  9
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.WildCardPathTest.StringWithWildcardsInPathShouldUseWildcardsInTwoFolderSegments () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 11) Failed : ThoughtWorks.CruiseControl.UnitTests.Core.Util.XslTransformerTest.ShouldFailWhenXslInvalid
 [exec]   Expected: <ThoughtWorks.CruiseControl.Core.CruiseControlException>
 [exec]   But was:  <System.ArgumentNullException: Value cannot be null.
 [exec] Parameter name: args
 [exec]   at System.String.Format (System.IFormatProvider provider, System.String format, System.Object[] args) [0x00003] in <671ef0784b04474c83bb500a849492f2>:0
 [exec]   at SR.GetString (System.Globalization.CultureInfo culture, System.String name, System.Object[] args) [0x00000] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at SR.GetString (System.String name, System.Object[] args) [0x00005] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Utils.Res.GetString (System.String name, System.Object[] args) [0x00000] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.XslTransformException.CreateMessage (System.String res, System.String[] args) [0x00002] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.XslTransformException..ctor (System.Exception inner, System.String res, System.String[] args) [0x00000] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.XslLoadException..ctor (System.Exception inner, System.Xml.Xsl.ISourceLineInfo lineInfo) [0x00000] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet (System.Xml.XmlReader reader, System.Boolean include) [0x00131] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.Xslt.XsltLoader.Load (System.Xml.XmlReader reader) [0x00017] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.Xslt.XsltLoader.Load (System.Xml.Xsl.Xslt.Compiler compiler, System.Object stylesheet, System.Xml.XmlResolver xmlResolver) [0x00099] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.Xslt.Compiler.Compile (System.Object stylesheet, System.Xml.XmlResolver xmlResolver, System.Xml.Xsl.Qil.QilExpression& qil) [0x00005] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.XslCompiledTransform.CompileXsltToQil (System.Object stylesheet, System.Xml.Xsl.XsltSettings settings, System.Xml.XmlResolver stylesheetResolver) [0x0000e] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.XslCompiledTransform.LoadInternal (System.Object stylesheet, System.Xml.Xsl.XsltSettings settings, System.Xml.XmlResolver stylesheetResolver) [0x00018] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at System.Xml.Xsl.XslCompiledTransform.Load (System.String stylesheetUri, System.Xml.Xsl.XsltSettings settings, System.Xml.XmlResolver stylesheetResolver) [0x00014] in <1df69a54e6a44b9498dc8e01aafc8e4a>:0
 [exec]   at ThoughtWorks.CruiseControl.Core.Util.XslTransformer.LoadStylesheet (System.Xml.Xsl.XslCompiledTransform transform, System.String xslFileName) [0x00010] in <d036085c2a5b4ee994fedc4c3b2455ac>:0
 [exec]   at ThoughtWorks.CruiseControl.Core.Util.XslTransformer.NewXslTransform (System.String transformerFileName) [0x00012] in <d036085c2a5b4ee994fedc4c3b2455ac>:0
 [exec]   at ThoughtWorks.CruiseControl.Core.Util.XslTransformer.Transform (System.String input, System.String xslFilename, System.Collections.Hashtable xsltArgs) [0x00000] in <d036085c2a5b4ee994fedc4c3b2455ac>:0
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.XslTransformerTest+<>c__DisplayClass7_0.<ShouldFailWhenXslInvalid>b__0 () [0x00005] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]   at (wrapper managed-to-native) System.Reflection.RuntimeMethodInfo.InternalInvoke(System.Reflection.RuntimeMethodInfo,object,object[],System.Exception&)
 [exec]   at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x0006a] in <671ef0784b04474c83bb500a849492f2>:0
 [exec] --- End of stack trace from previous location where exception was thrown ---
 [exec]
 [exec]   at NUnit.Framework.Internal.ExceptionHelper.Rethrow (System.Exception exception) [0x00006] in <be0e2b70ca254bb684417cccea7d5290>:0
 [exec]   at NUnit.Framework.Internal.Reflect.DynamicInvokeWithTransparentExceptions (System.Delegate delegate) [0x00014] in <be0e2b70ca254bb684417cccea7d5290>:0
 [exec]   at NUnit.Framework.Internal.ExceptionHelper.RecordException (System.Delegate parameterlessDelegate, System.String parameterName) [0x00067] in <be0e2b70ca254bb684417cccea7d5290>:0 >
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.Core.Util.XslTransformerTest.ShouldFailWhenXslInvalid () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 12) Failed : ThoughtWorks.CruiseControl.UnitTests.IntegrationTests.PublisherTests.PackagePublisherPackageFolderMustRespectHierarchy
 [exec]   Expected string length 42 but was 0. Strings differ at index 0.
 [exec]   Expected: "MegaWebSite/AFolder/b.txtMegaWebSite/a.txt"
 [exec]   But was:  <string.Empty>
 [exec]   -----------^
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.IntegrationTests.PublisherTests.PackagePublisherPackageFolderMustRespectHierarchy () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 13) Failed : ThoughtWorks.CruiseControl.UnitTests.IntegrationTests.PublisherTests.PackagePublisherWithFlattenFiles
 [exec]   Expected string length 10 but was 0. Strings differ at index 0.
 [exec]   Expected: "a.txtb.txt"
 [exec]   But was:  <string.Empty>
 [exec]   -----------^
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.IntegrationTests.PublisherTests.PackagePublisherWithFlattenFiles () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0
 [exec]
 [exec] 14) Failed : ThoughtWorks.CruiseControl.UnitTests.IntegrationTests.PublisherTests.PackagePublisherWithoutFlattenFiles
 [exec]   Expected string length 30 but was 0. Strings differ at index 0.
 [exec]   Expected: "Info/Sub1/a.txtInfo/Sub1/b.txt"
 [exec]   But was:  <string.Empty>
 [exec]   -----------^
 [exec]   at ThoughtWorks.CruiseControl.UnitTests.IntegrationTests.PublisherTests.PackagePublisherWithoutFlattenFiles () [0x00000] in <dac301ed37f1469e88502226d4a9082d>:0

Any hints/pointers are most welcome, I'll keep updating this branch with new fixes

@obones
Copy link
Contributor Author

obones commented Jan 20, 2021

8, 9 and 10 are fixed by commit 6b1e327

…er depending on the platform. Sorting them manually is a sure way to have a stable order
…ance under Windows, but it definitely does not under Mono/Linux
@savornicesei savornicesei merged commit 69290fe into ccnet:master Feb 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants