public static Task StartFunctionWithAdditionalConfigurationAsync(FeatureContext featureContext)
        {
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(featureContext);

            functionConfiguration.EnvironmentVariables.Add("ResponseMessage", "Welcome, {name}");

            return(StartFunctionsAsync(featureContext));
        }
예제 #2
0
        public Task StartFunctionWithAdditionalConfigurationAsync(ScenarioContext scenarioContext)
        {
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(scenarioContext);

            functionConfiguration.EnvironmentVariables.Add("ResponseMessage", "Welcome, {name}");

            return(this.StartFunctionsAsync(scenarioContext));
        }
예제 #3
0
        public void GivenIHaveSetAdditionalConfigurationForFunctionsInstances(Table table)
        {
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(this.scenarioContext);

            foreach (TableRow row in table.Rows)
            {
                functionConfiguration.EnvironmentVariables.Add(row[0], row[1]);
            }
        }
        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));
        }
예제 #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));
        }
        private static void UpdateServiceConfigurationWithTransientTenantId(
            FeatureContext featureContext,
            ITenant transientServiceTenant)
        {
            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(featureContext);

            functionConfiguration.EnvironmentVariables.Add(
                "MarainServiceConfiguration:ServiceTenantId",
                transientServiceTenant.Id);

            functionConfiguration.EnvironmentVariables.Add(
                "MarainServiceConfiguration:ServiceDisplayName",
                transientServiceTenant.Name);
        }
예제 #7
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)));
        }
        private static void UpdateServiceConfigurationWithTransientTenantId(
            FeatureContext featureContext,
            ITenant transientServiceTenant)
        {
            MarainServiceConfiguration configuration = ContainerBindings
                                                       .GetServiceProvider(featureContext)
                                                       .GetRequiredService <MarainServiceConfiguration>();

            configuration.ServiceTenantId    = transientServiceTenant.Id;
            configuration.ServiceDisplayName = transientServiceTenant.Name;

            FunctionConfiguration functionConfiguration = FunctionsBindings.GetFunctionConfiguration(featureContext);

            functionConfiguration.EnvironmentVariables.Add(
                "MarainServiceConfiguration:ServiceTenantId",
                configuration.ServiceTenantId);

            functionConfiguration.EnvironmentVariables.Add(
                "MarainServiceConfiguration:ServiceDisplayName",
                configuration.ServiceDisplayName);
        }
예제 #9
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));
        }