CppStars / mb-unit

Automatically exported from code.google.com/p/mb-unit
0 stars 0 forks source link

Gallio generated temporary .config file is not valid when configSource is used in the original .config file #901

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Gallio-3.4.14 on Windows XP 32 bits

Create an app.config for a test assembly that uses a configSource for 
system.diagnostics
<configuration>
  <system.diagnostics configSource="Config\System.Diagnostics.config"/>
  </system.diagnostics>
</configuration>

Gallio.Echo generates a temporary config file which contains :
<configuration>
  <system.diagnostics configSource="Config\System.Diagnostics.config">
    <assert assertuienabled="false" />
  </system.diagnostics>
</configuration>

which is not valid.

Gallio fails with error :
A fatal exception occurred while running tests.  Possible causes include 
invalid test runner parameters and stack overflows.
        Gallio.Model.ModelException: An exception occurred while invoking a test driver. ---> Gallio.Runtime.RuntimeException: The runtime could not be initialized. ---> System.Configuration.ConfigurationErrorsException: Configuration system failed to initialize ---> System.Configuration.Configurati
onErrorsException: A section using 'configSource' may contain no other 
attributes or elements. 
(D:\Views\Tamaillon_MAIN_view\TOne\tone\src\bin\Tests\Debug\69cea06f98552a6f.tmp
.config line 4)
        BareMessage: A section using 'configSource' may contain no other attributes or elements.
        Filename: D:\Views\Tamaillon_MAIN_view\TOne\tone\src\bin\Tests\Debug\69cea06f98552a6f.tmp.config
        Line: 4
        Errors: System.Configuration.ConfigurationException[]
           at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
           at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
           at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
           at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
           --- End of inner exception stack trace ---
        BareMessage: Configuration system failed to initialize
        Line: 0
        Errors: System.Configuration.ConfigurationException[]
           at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
           at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(String sectionName)
           at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(String sectionName)
           at System.Configuration.ConfigurationManager.GetSection(String sectionName)
           at Gallio.Runtime.DefaultRuntime.RegisterLoadedPlugins() in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Runtime\DefaultRuntime.cs:line 255
           at Gallio.Runtime.DefaultRuntime.Initialize() in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Runtime\DefaultRuntime.cs:line 170
           --- End of inner exception stack trace ---
           at Gallio.Runtime.DefaultRuntime.Initialize() in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Runtime\DefaultRuntime.cs:line 197
           at Gallio.Runtime.RuntimeBootstrap.Initialize(RuntimeSetup setup, ILogger logger) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Runtime\RuntimeBootstrap.cs:line 74
           at Gallio.Model.Isolation.HostedTestIsolationContext.Shim.Initialize(RuntimeSetup runtimeSetup, ILogger logger) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\Isolation\HostedTestIsolationContext.cs:line 170
           at Gallio.Model.Isolation.HostedTestIsolationContext.Shim.Initialize(RuntimeSetup runtimeSetup, ILogger logger)
           at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskInHost[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\Isolation\HostedTestIsolationContext.cs:line 110
           at Gallio.Model.Isolation.HostedTestIsolationContext.RunIsolatedTaskImpl[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\Isolation\HostedTestIsolationContext.cs:line 83
           at Gallio.Model.Isolation.BaseTestIsolationContext.RunIsolatedTask[TIsolatedTask](HostSetup hostSetup, StatusReporter statusReporter, Object[] args) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\Isolation\BaseTestIsolationContext.cs:line 64
           at Gallio.Model.DotNetTestDriver.ExploreOrRunAssembly(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, RemoteMessageSink remoteMessageSink, IProgressMonitor progressMonitor, Strin
g taskName, FileInfo file) in c:\Server\Projects\MbUnit 
v3\Work\src\Gallio\Gallio\Model\DotNetTestDriver.cs:line 195
           at Gallio.Model.DotNetTestDriver.ExploreOrRun(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor, String taskName) in c:\S
erver\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DotNetTestDriver.cs:line 
162
           at Gallio.Model.DotNetTestDriver.RunImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit
v3\Work\src\Gallio\Gallio\Model\DotNetTestDriver.cs:line 147
           at Gallio.Model.BaseTestDriver.Run(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit v3\Wor
k\src\Gallio\Gallio\Model\BaseTestDriver.cs:line 95
           at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.<>c__DisplayClass1f.<RunImpl>b__1d(ITestDriver driver, IList`1 items, Int32 driverCount) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 466
           at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 528
           --- End of inner exception stack trace ---
           at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.ForEachDriver[T](MultiMap`2 testFrameworkPartitions, Func`4 func) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 534
           at Gallio.Model.DefaultTestFrameworkManager.FilteredTestDriver.RunImpl(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor)
 in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Model\DefaultTestFrameworkManager.cs:line 461
           at Gallio.Model.BaseTestDriver.Run(ITestIsolationContext testIsolationContext, TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IMessageSink messageSink, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit v3\Wor
k\src\Gallio\Gallio\Model\BaseTestDriver.cs:line 95
           at Gallio.Runner.DefaultTestRunner.Run(TestPackage testPackage, TestExplorationOptions testExplorationOptions, TestExecutionOptions testExecutionOptions, IProgressMonitor progressMonitor) in c:\Server\Projects\MbUnit v3\Work\src\Gallio\Gallio\Runner\DefaultTestRunner.cs:line 315

I suggest to replace the configSource attribute by the content of the linked 
file, and then add/update any attribute neededby Gallio. The file would then be 
valid.

Original issue reported on code.google.com by arnaud.t...@gmail.com on 26 Oct 2012 at 4:30

GoogleCodeExporter commented 8 years ago
Here is a patch proposal for this issue.

Please let me know if something is to be changed.

Original comment by arnaud.t...@gmail.com on 4 Nov 2012 at 9:21

Attachments: