Ejemplo n.º 1
0
 public void StartLocalDeployment_starts_a_deployment()
 {
     using (var manager = SpatialdManager.Start().Result)
         using (manager.StartLocalDeployment("test", "default_launch.json").Result)
         {
             Assert.IsNotEmpty(manager.GetRunningDeployments().Result);
         }
 }
Ejemplo n.º 2
0
        public void OneTimeSetup()
        {
            if (!DevAuthTokenUtils.TryGenerate())
            {
                throw new ArgumentException("Could not generate a dev auth token.");
            }

            spatiald = SpatialdManager.Start().Result;
        }
Ejemplo n.º 3
0
        public void LocalDeployment_closes_deployment_on_dispose()
        {
            using (var manager = SpatialdManager.Start().Result)
            {
                using (manager.StartLocalDeployment("test", "default_launch.json").Result)
                {
                }

                Assert.IsEmpty(manager.GetRunningDeployments().Result);
            }
        }
Ejemplo n.º 4
0
        public void Spatiald_is_running_after_Start()
        {
            using (SpatialdManager.Start().Result)
            {
                var result = RedirectedProcess.Spatial("service", "status")
                             .InDirectory(Common.SpatialProjectRootDir)
                             .RedirectOutputOptions(OutputRedirectBehaviour.None)
                             .RunAsync()
                             .Result;

                Assert.IsTrue(result.Stdout.Any(line => line.Contains("Local API service is running")));
            }
        }
Ejemplo n.º 5
0
 public void LocalDeployment_can_add_dev_login_tag()
 {
     using (var manager = SpatialdManager.Start().Result)
     {
         using (var depl = manager.StartLocalDeployment("test", "default_launch.json").Result)
         {
             Assert.DoesNotThrow(() => depl.AddDevLoginTag().Wait());
             var deployments  = manager.GetRunningDeployments().Result;
             var myDeployment = deployments[0];
             Assert.Contains("dev_login", myDeployment.Tags);
             Assert.Contains("dev_login", depl.Tags);
         }
     }
 }
Ejemplo n.º 6
0
        public void StartLocalDeployment_throws_if_invalid_snapshot_name()
        {
            using (var manager = SpatialdManager.Start().Result)
            {
                var aggregateException = Assert.Throws <AggregateException>(() =>
                {
                    var deployment = manager.StartLocalDeployment("test", "default_launch.json", "doesnt_exist.snapshot").Result;

                    // Shouldn't get here, but just in case ;)
                    deployment.Dispose();
                });

                Assert.IsInstanceOf <ArgumentException>(aggregateException.InnerExceptions[0]);
            }
        }