Exemple #1
0
        public static void WriteOutput(FeatureContext featureContext)
        {
            ILogger <FunctionsController> logger = ContainerBindings.GetServiceProvider(featureContext).GetRequiredService <ILogger <FunctionsController> >();
            FunctionsController           functionsController = FunctionsBindings.GetFunctionsController(featureContext);

            logger.LogAllAndClear(functionsController.GetFunctionsOutput());
        }
Exemple #2
0
        public static void WriteOutput(FeatureContext featureContext)
        {
            ILogger             logger = featureContext.Get <ILogger>();
            FunctionsController functionsController = FunctionsBindings.GetFunctionsController(featureContext);

            logger.LogAllAndClear(functionsController.GetFunctionsOutput());
        }
Exemple #3
0
 public static void StopManagementApi(FeatureContext featureContext)
 {
     featureContext.RunAndStoreExceptions(
         () =>
     {
         FunctionsController functionsController = FunctionsBindings.GetFunctionsController(featureContext);
         functionsController.TeardownFunctions();
     });
 }
        public static Task StartFunctionsAsync(FeatureContext featureContext)
        {
            FunctionsController   functionsController   = FunctionsBindings.GetFunctionsController(featureContext);
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(featureContext);

            return(functionsController.StartFunctionsInstance(
                       "Corvus.Testing.AzureFunctions.DemoFunction",
                       7075,
                       "netcoreapp3.1",
                       configuration: functionConfiguration));
        }
Exemple #5
0
        public static Task StartWorkflowEngineFunctionAsync(FeatureContext context)
        {
            FunctionConfiguration config = FunctionsBindings.GetFunctionConfiguration(context);

            config.EnvironmentVariables["AzureFunctionsJobHost:logging:logLevel:default"] = "Debug";

            return(FunctionsBindings.GetFunctionsController(context).StartFunctionsInstance(
                       "Marain.Workflow.Api.EngineHost",
                       EngineHostPort,
                       "net6.0",
                       "csharp",
                       config));
        }
Exemple #6
0
        public static Task StartManagementApi(FeatureContext featureContext)
        {
            FunctionsController   functionsController   = FunctionsBindings.GetFunctionsController(featureContext);
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(featureContext);

            functionConfiguration.EnvironmentVariables.Add("UserNotificationsManagementClient:BaseUri", ManagementApiBaseUri.ToString());
            functionConfiguration.EnvironmentVariables.Add("UserNotificationsApiDeliveryChannelClient:BaseUri", ApiDeliveryChannelBaseUri.ToString());

            return(Task.WhenAll(
                       functionsController.StartFunctionsInstance(
                           "Marain.UserNotifications.Management.Host",
                           ManagementApiPort,
                           "netcoreapp3.1",
                           configuration: functionConfiguration),
                       functionsController.StartFunctionsInstance(
                           "Marain.UserNotifications.ApiDeliveryChannel.Host",
                           ApiDeliveryChannelPort,
                           "netcoreapp3.1",
                           configuration: functionConfiguration)));
        }
Exemple #7
0
        public static async Task StartApis(FeatureContext featureContext)
        {
            FunctionsController   functionsController   = FunctionsBindings.GetFunctionsController(featureContext);
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(featureContext);

            IConfiguration configuration = ContainerBindings.GetServiceProvider(featureContext).GetRequiredService <IConfiguration>();

            functionConfiguration.CopyToEnvironmentVariables(configuration.AsEnumerable());
            functionConfiguration.EnvironmentVariables.Add("ExternalServices:OperationsStatus", StatusApiBaseUrl);

            await Task.WhenAll(
                functionsController.StartFunctionsInstance(
                    "Marain.Operations.ControlHost.Functions",
                    ControlApiPort,
                    "net6.0",
                    configuration: functionConfiguration),
                functionsController.StartFunctionsInstance(
                    "Marain.Operations.StatusHost.Functions",
                    StatusApiPort,
                    "net6.0",
                    configuration: functionConfiguration));
        }
        public static void StopFunction(FeatureContext featureContext)
        {
            FunctionsController functionsController = FunctionsBindings.GetFunctionsController(featureContext);

            functionsController.TeardownFunctions();
        }
        public static void WriteOutput(FeatureContext featureContext)
        {
            FunctionsController functionsController = FunctionsBindings.GetFunctionsController(featureContext);

            functionsController.GetFunctionsOutput().WriteAllToConsoleAndClear();
        }
Exemple #10
0
        public void StopFunction(ScenarioContext scenarioContext)
        {
            FunctionsController functionsController = FunctionsBindings.GetFunctionsController(scenarioContext);

            functionsController.TeardownFunctions();
        }