From cded685b858bdc425a14d3c455ff3037f7d94f07 Mon Sep 17 00:00:00 2001 From: kpunwatk Date: Tue, 5 Sep 2023 16:42:11 +0530 Subject: [PATCH] [WIP] Custom metrics after bulk analyses Signed-off-by: Karishma Punwatkar modified: cypress/e2e/tests/migration/applicationinventory/analysis/bulk_analysis.test.ts --- .../analysis/bulk_analysis.test.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/tests/migration/applicationinventory/analysis/bulk_analysis.test.ts b/cypress/e2e/tests/migration/applicationinventory/analysis/bulk_analysis.test.ts index 6ae62026d..3788635d1 100644 --- a/cypress/e2e/tests/migration/applicationinventory/analysis/bulk_analysis.test.ts +++ b/cypress/e2e/tests/migration/applicationinventory/analysis/bulk_analysis.test.ts @@ -24,11 +24,15 @@ import { import { Analysis } from "../../../../models/migration/applicationinventory/analysis"; import { Assessment } from "../../../../models/migration/applicationinventory/assessment"; import { AnalysisStatuses } from "../../../../types/constants"; +import { Metrics } from "../../../../models/migration/custom-metrics/custom-metrics"; const analyses: Analysis[] = []; const NUMBER_OF_APPS = 25; +const metrics = new Metrics(); +const metricName = "konveyor_tasks_initiated_total"; +let counter: number; -describe(["@tier4"], "Bulk Analysis", () => { +describe(["@tier4"], "Custom metrics after bulk Analysis", () => { before("Login", function () { login(); cy.fixture("application").then((appData) => { @@ -47,11 +51,20 @@ describe(["@tier4"], "Bulk Analysis", () => { analyses.forEach((analysis) => analysis.create()); }); }); + + // Get the current counter value + metrics.getValue(metricName).then((counterValue) => { + counter = counterValue; + }); }); - it("Bulk analysis of source code + open source deps + known deps", function () { + it("Count the tasks after bulk analysis of source code + open source deps + known deps", function () { Analysis.analyzeAll(analyses[0]); Analysis.verifyAllAnalysisStatuses(AnalysisStatuses.completed); + counter = counter + 25; + + // Validate the tasks initiated counter increased + metrics.validateMetric(metricName, counter); }); after("Perform test data clean up", function () {