Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kathy-t committed Feb 26, 2024
1 parent b07b184 commit 4287524
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -599,21 +599,21 @@ void testAggregateExecutionsWithDuplicateIds() {
platform, id, versionId, ""));

// Send them one at a time. The last execution sent should be the one that the metrics aggregator aggregates
extendedGa4GhApi.executionMetricsPost(new ExecutionsRequestBody().validationExecutions(List.of(validationExecution)), platform, id, versionId, "");
extendedGa4GhApi.executionMetricsPost(new ExecutionsRequestBody().runExecutions(List.of(workflowExecution)), platform, id, versionId, "");
extendedGa4GhApi.executionMetricsPost(new ExecutionsRequestBody().taskExecutions(List.of(taskExecutions)), platform, id, versionId, "");
extendedGa4GhApi.executionMetricsPost(new ExecutionsRequestBody().validationExecutions(List.of(validationExecution)), platform, id, versionId, "");

MetricsAggregatorClient.main(new String[] {"aggregate-metrics", "--config", CONFIG_FILE_PATH});
// Get workflow version to verify aggregated metrics
workflow = workflowsApi.getPublishedWorkflow(32L, "metrics");
version = workflow.getWorkflowVersions().stream().filter(v -> "master".equals(v.getName())).findFirst().orElse(null);
Metrics metrics = version.getMetricsByPlatform().get(platform);
assertNotNull(metrics);
// Should be aggregated from validationExecution because it was submitted last
// Should be aggregated from taskExecutions because it was submitted last
MetricsByStatus successfulMetrics = metrics.getExecutionStatusCount().getCount().get(SUCCESSFUL.name());
assertNotNull(metrics.getValidationStatus()); // Verify that the metric from validation execution was used
assertNotNull(successfulMetrics.getCpu()); // Verify that the metric from task executions was used
assertNull(successfulMetrics.getExecutionTime()); // Verify that the metric from workflow execution wasn't used
assertNull(successfulMetrics.getCpu()); // Verify that the metric from task executions weren't used
assertNull(metrics.getValidationStatus()); // Verify that the metric from validation execution wasn't used

// Submit a workflow execution. The metric should be from the latest workflow execution.
workflowExecution.setExecutionTime("PT0S"); // Change execution time so it's different from the first workflow execution
Expand Down

0 comments on commit 4287524

Please sign in to comment.