Run Gallio Programmatically

135 views
Skip to first unread message

Edmond

unread,
Aug 19, 2011, 1:28:52 PM8/19/11
to gallio-user
Hi,

I am trying to launch Gallio through my console application instead of
using the Gallio GUI (so that I can set up scheduled run in the
future). I tried the code in the following posting:

http://groups.google.com/group/gallio-user/browse_thread/thread/afab404a14674cd2

However, I got the following exception which I could not decipher:

Gallio.Runtime.RuntimeException was unhandled
Message=Could not resolve component for service type
'Gallio.Runner.Projects.ITestProjectManager' because there do not
appear to be any components registered and enabled for that service
type.
Source=Gallio
StackTrace:
at
Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveNonDisabledDescriptor(Type
serviceType)
at
Gallio.Runtime.Extensibility.RegistryServiceLocator.ResolveImpl(Type
serviceType)
at
Gallio.Runtime.Extensibility.RegistryServiceLocator.Resolve[TService]
()
at Gallio.Runner.TestLauncher.RunWithRuntime()
at Gallio.Runner.TestLauncher.Run()
at Dundas.Dashboard.TestSystem.TestPrograms.Driver.RunTests()
in C:\...\Driver.cs:line 101
at Dundas.Dashboard.TestSystem.Program.Main(String[] args) in C:
\...\Program.cs:line 13
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly,
String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile,
Evidence assemblySecurity, String[] args)
at
Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object
state)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state, Boolean
ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext
executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:

What could be going wrong there?

Regards,
Edmond

Brett

unread,
Mar 12, 2012, 6:32:18 PM3/12/12
to galli...@googlegroups.com
I think you just need to pass a plugin directory, for me i just added the gallio path in program files. Snippet below

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Gallio.Runtime.Logging;
using Gallio.Runtime.ConsoleSupport;
using Gallio.Runtime;
using Gallio.Runner;
using Gallio.Runtime.ProgressMonitoring;
using System.Reflection;
using System.IO;

namespace WebSiteAutomationGallioProgramatically
{
    class Program
    {
        static void Main(string[] args)
        {
            RunGallio runGallio = new RunGallio();
        }

        public class RunGallio
        {
            public RunGallio()
            {
                ILogger logger = (ILogger)new RichConsoleLogger(NativeConsole.Instance);
                var setup = new Gallio.Runtime.RuntimeSetup();
                setup.AddPluginDirectory(@"C:\Program Files\Gallio\bin\"); //plugin directory aka gallio folder in programfiles
                RuntimeBootstrap.Initialize(setup, logger);
                var launcher = new TestLauncher()
                {
                    Logger = logger,
                    ProgressMonitorProvider = NullProgressMonitorProvider.Instance
                };
                launcher.RuntimeSetup = setup;
                Assembly assembly = this.GetType().Assembly;
                FileInfo assemblyInfo = new FileInfo(assembly.Location);
                launcher.TestProject.TestRunnerFactoryName = StandardTestRunnerFactoryNames.Local;
                launcher.AddFilePattern(assembly.Location);
                launcher.Run();

Test wmv

unread,
Mar 14, 2016, 11:57:25 PM3/14/16
to gallio-user

Hi,

I have created my automated tests using Mbunit and I currently run it using the Gallio.Icarus manually and I see the test is running fine.
Now, I wanted to run the automated test in command line using Gallio.Echo. I need some guidance on how can I do. Any step by step guide would help me a lot.

Please let me know the checklists that I should verify before using Gallio Echo. I just have Galli Echo installed in this path "C:\Gallio\bin" and my automated test dll resides in this path "C:\Users\Suba\Documents\Visual Studio 2013\Projects\Links\Links\bin\Debug\Tests.dll", what is the command line syntax i should use to run my Tests.dll from command line using Gallio Echo.

It would be great if some one can help me with this asap.

Regards,
Suba

Ed

unread,
Mar 15, 2016, 8:53:19 AM3/15/16
to galli...@googlegroups.com
Hi Suba,

It appears MbUnit\Gallio is no longer supported. Hard to say whether anyone knowledgeable of how to run Echo will answer since it's been unsupported for a long time.

While I loved using MbUnit and Gallio I needed to use something that was supported. I moved to using NUnit and NCrunch.Net. NCrunch is a fantastic test runner. I don't know if one can run tests at the command line with NCrunch.Net.

Thanks, Ed

--
You received this message because you are subscribed to the Google Groups "gallio-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gallio-user...@googlegroups.com.
To post to this group, send email to galli...@googlegroups.com.
Visit this group at https://groups.google.com/group/gallio-user.
For more options, visit https://groups.google.com/d/optout.


Reply all
Reply to author
Forward
0 new messages