Example #1
0
        public void ArgumentPropertyTest(string functions_worker_runtime,
                                         bool expectedRunOryxBuild, bool expectedSkipKuduSync, BuildOptimizationsFlags expectedFlags)
        {
            var mockedEnvironment = new Dictionary <string, string>()
            {
                { "FUNCTIONS_WORKER_RUNTIME", functions_worker_runtime },
            };

            using (new TestScopedEnvironmentVariable(mockedEnvironment))
            {
                IOryxArguments args = new LinuxConsumptionFunctionAppOryxArguments();
                Assert.Equal(expectedRunOryxBuild, args.RunOryxBuild);
                Assert.Equal(expectedSkipKuduSync, args.SkipKuduSync);
                Assert.Equal(expectedFlags, args.Flags);
            }
        }
Example #2
0
        public void DefaultTest()
        {
            IOryxArguments args = new LinuxConsumptionFunctionAppOryxArguments();

            Assert.False(args.RunOryxBuild);
            Assert.True(args.SkipKuduSync);
            Assert.Equal(BuildOptimizationsFlags.Off, args.Flags);

            var mockedContext = new DeploymentContext()
            {
                RepositoryPath = "RepositoryPath",
                BuildTempPath  = "BuildTempPath", // Should be ignored
                OutputPath     = "OutputPath"
            };
            string command = args.GenerateOryxBuildCommand(mockedContext);

            Assert.Equal("oryx build RepositoryPath -o OutputPath", command);
        }
Example #3
0
        public void CommandGenerationTest(string functions_worker_runtime, string expected_command)
        {
            var mockedEnvironment = new Dictionary <string, string>()
            {
                { "FUNCTIONS_WORKER_RUNTIME", functions_worker_runtime },
            };

            var mockedContext = new DeploymentContext()
            {
                RepositoryPath = "RepositoryPath",
                BuildTempPath  = "BuildTempPath", // Should be ignored
                OutputPath     = "OutputPath"     // Should be ignored
            };

            using (new TestScopedEnvironmentVariable(mockedEnvironment))
            {
                IOryxArguments args    = new LinuxConsumptionFunctionAppOryxArguments();
                string         command = args.GenerateOryxBuildCommand(mockedContext);
                Assert.Equal(expected_command, command);
            }
        }