From c1f53a201db79a975b34166a2fc54338ba86f85c Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Mon, 22 May 2023 15:37:40 -0400 Subject: [PATCH 1/3] Fix to table query --- .../DataAccess/TableStorage/TableStorageCommonDA.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DevOpsMetrics.Core/DataAccess/TableStorage/TableStorageCommonDA.cs b/src/DevOpsMetrics.Core/DataAccess/TableStorage/TableStorageCommonDA.cs index c8e69b76..8d177f0c 100644 --- a/src/DevOpsMetrics.Core/DataAccess/TableStorage/TableStorageCommonDA.cs +++ b/src/DevOpsMetrics.Core/DataAccess/TableStorage/TableStorageCommonDA.cs @@ -82,7 +82,7 @@ public List GetItems(string partitionKey) // execute the query on the table List list = table.CreateQuery() - //.Where(ent => ent.PartitionKey == partitionKey) + .Where(ent => ent.PartitionKey == partitionKey) .ToList(); return list; From 3b2fc83ceccefaa5cd2ee0dede013e15725a6670 Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Mon, 22 May 2023 16:07:55 -0400 Subject: [PATCH 2/3] Fix to test --- src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs b/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs index abaf3396..43b77580 100644 --- a/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs +++ b/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs @@ -33,7 +33,7 @@ public async Task DORASummaryControllerUpdateIntegrationTest() string organization = "DeveloperMetrics"; string repository = "DevOpsMetrics"; string branch = "main"; - string workflowName = "1162561"; + string workflowName = "CI/CD"; string workflowId = "1162561"; string resourceGroup = "DevOpsMetrics"; int numberOfDays = 30; From 1e87b773331a50f057df114604a3ca922443bd7d Mon Sep 17 00:00:00 2001 From: Sam Smith Date: Mon, 22 May 2023 16:25:02 -0400 Subject: [PATCH 3/3] Fix to include build time and pr time --- .../DataAccess/LeadTimeForChangesDA.cs | 2 +- .../Service/DORASummaryControllerTests.cs | 29 ++++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/DevOpsMetrics.Core/DataAccess/LeadTimeForChangesDA.cs b/src/DevOpsMetrics.Core/DataAccess/LeadTimeForChangesDA.cs index d7082a8a..5134a370 100644 --- a/src/DevOpsMetrics.Core/DataAccess/LeadTimeForChangesDA.cs +++ b/src/DevOpsMetrics.Core/DataAccess/LeadTimeForChangesDA.cs @@ -323,7 +323,7 @@ public static async Task GetGitHubLeadTimesForChanges(b AverageBuildHours = averageBuildHours, AveragePullRequestHours = leadTime, LeadTimeForChangesMetric = leadTime + averageBuildHours, - LeadTimeForChangesMetricDescription = LeadTimeForChanges.GetLeadTimeForChangesRating(leadTime), + LeadTimeForChangesMetricDescription = LeadTimeForChanges.GetLeadTimeForChangesRating(leadTime + averageBuildHours), PullRequests = utility.GetLastNItems(pullRequests, maxNumberOfItems), NumberOfDays = numberOfDays, MaxNumberOfItems = uiPullRequests.Count, diff --git a/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs b/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs index 43b77580..c69567ce 100644 --- a/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs +++ b/src/DevOpsMetrics.Tests/Service/DORASummaryControllerTests.cs @@ -24,18 +24,39 @@ public void DORASummaryControllerGetIntegrationTest() //Assert Assert.IsNotNull(model); + } + [TestMethod] + public void DORASummaryControllerGetIntegrationTest2() + { + //Arrange + string organization = "samsmithnz"; + string repository = "AzurePipelinesToGitHubActionsConverter"; + DORASummaryController controller = new(base.Configuration); + + //Act + DORASummaryItem model = controller.GetDORASummaryItem(organization, repository); + + //Assert + Assert.IsNotNull(model); + } [TestMethod] public async Task DORASummaryControllerUpdateIntegrationTest() { //Arrange - string organization = "DeveloperMetrics"; - string repository = "DevOpsMetrics"; + string organization = "samsmithnz"; + string repository = "AzurePipelinesToGitHubActionsConverter"; string branch = "main"; string workflowName = "CI/CD"; - string workflowId = "1162561"; - string resourceGroup = "DevOpsMetrics"; + string workflowId = "38158"; + string resourceGroup = "PipelinesToActions"; + //string organization = "DeveloperMetrics"; + //string repository = "DevOpsMetrics"; + //string branch = "main"; + //string workflowName = "CI/CD"; + //string workflowId = "1162561"; + //string resourceGroup = "DevOpsMetrics"; int numberOfDays = 30; int maxNumberOfItems = 20; DORASummaryController controller = new(base.Configuration);