Пример #1
0
        public void Execute()
        {
            var temp = Path.GetTempPath();
            var dir  = Path.Combine(temp, Guid.NewGuid().ToString());

            Directory.CreateDirectory(dir);

            var configPath = Path.Combine(dir, "OptProf.json");

            File.WriteAllText(configPath, products_only);

            var bootstrapperPath = Path.Combine(dir, "BootstrapperInfo.json");

            File.WriteAllText(bootstrapperPath, @"[{""BuildDrop"": ""https://vsdrop.corp.microsoft.com/file/v1/Products/42.42.42.42/42.42.42.42""}]");

            var task = new GetRunSettingsSessionConfiguration()
            {
                ConfigurationFile    = configPath,
                ProductDropName      = "Products/abc",
                BootstrapperInfoPath = bootstrapperPath
            };

            bool result = task.Execute();

            Assert.Equal(
                $@"<TestStores>
  <TestStore Uri=""vstsdrop:ProfilingInputs/abc"" />
  <TestStore Uri=""vstsdrop:Tests/42.42.42.42/42.42.42.42"" />
</TestStores>
<TestContainers>
  <TestContainer FileName=""DDRIT.RPS.CSharp.dll"" />
  <TestContainer FileName=""VSPE.dll"" />
</TestContainers>
<TestCaseFilter>FullyQualifiedName=DDRIT.RPS.CSharp.CSharpTest.EditingAndDesigner|FullyQualifiedName=VSPE.OptProfTests.vs_perf_designtime_ide_searchtest|FullyQualifiedName=VSPE.OptProfTests.vs_perf_designtime_editor_intellisense_globalcompletionlist_cs|FullyQualifiedName=VSPE.OptProfTests.vs_asl_cs_scenario|FullyQualifiedName=VSPE.OptProfTests.vs_ddbvtqa_vbwi|FullyQualifiedName=VSPE.OptProfTests.vs_asl_vb_scenario|FullyQualifiedName=VSPE.OptProfTests.vs_env_solution_createnewproject_vb_winformsapp|FullyQualifiedName=DDRIT.RPS.CSharp.CSharpTest.BuildAndDebugging</TestCaseFilter>", task.SessionConfiguration);

            Assert.True(result);

            Directory.Delete(dir, recursive: true);
        }
Пример #2
0
 public void TestProductsOnly(string configJson, string expectedContainerString, string expectedTestCaseFilterString)
 {
     var(actualContainerString, actualTestCaseFilterString) = GetRunSettingsSessionConfiguration.GetTestContainersAndFilters(configJson, "config.json");
     Assert.Equal(expectedContainerString, actualContainerString);
     Assert.Equal(expectedTestCaseFilterString, actualTestCaseFilterString);
 }
Пример #3
0
 public static void TestsIncorrectJsonFiles(string jsonString)
 {
     Assert.Throws <InvalidDataException>(() => GetRunSettingsSessionConfiguration.GetTestsDropName(jsonString));
 }
Пример #4
0
 public static void TestsCorrectJsonFiles(string jsonString, string expectedUrl)
 {
     Assert.Equal(expectedUrl, GetRunSettingsSessionConfiguration.GetTestsDropName(jsonString));
 }