コード例 #1
0
        private static void UploadCodeCoverageAttachmentsToNewStore(string folder, VssConnection connection, int buildId, string projectId)
        {
            TestLogStore logStore             = new TestLogStore(connection, new LogTraceListener());
            Dictionary <string, string> files = new Dictionary <string, string>();

            foreach (var file in Directory.EnumerateFiles(folder, "*.coverage", SearchOption.AllDirectories))
            {
                if (files.TryGetValue(Path.GetFileName(file), out string something))
                {
                    continue;
                }
                else
                {
                    files.Add(Path.GetFileName(file), file);
                    Dictionary <string, string> metaData = new Dictionary <string, string>();
                    metaData.Add("ModuleName", Path.GetFileName(file));
                    var attachment = logStore.UploadTestBuildLogAsync(new Guid(projectId), buildId, Microsoft.TeamFoundation.TestManagement.WebApi.TestLogType.Intermediate, file, metaData, null, false, System.Threading.CancellationToken.None).Result;
                }
            }

            foreach (var file in Directory.EnumerateFiles(folder, "*.coveragebuffer", SearchOption.AllDirectories))
            {
                Dictionary <string, string> metaData = new Dictionary <string, string>();
                metaData.Add("ModuleName", Path.GetFileName(file));
                var attachment = logStore.UploadTestBuildLogAsync(new Guid(projectId), buildId, Microsoft.TeamFoundation.TestManagement.WebApi.TestLogType.Intermediate, file, metaData, null, true, System.Threading.CancellationToken.None).Result;
            }
        }
コード例 #2
0
 public Task <TestLogStatus> UploadTestBuildLogAsync(Guid projectId, int buildId, TestLogType logType, string logFileSourcePath, Dictionary <string, string> metaData, string destDirectoryPath, bool allowDuplicate, CancellationToken cancellationToken)
 {
     return(_logStore.UploadTestBuildLogAsync(projectId, buildId, logType, logFileSourcePath, metaData, destDirectoryPath, allowDuplicate, cancellationToken));
 }