Skip to content

Commit

Permalink
[WIP] Custom metrics after bulk analyses
Browse files Browse the repository at this point in the history
Signed-off-by: Karishma Punwatkar <[email protected]>

	modified:   cypress/e2e/tests/migration/applicationinventory/analysis/bulk_analysis.test.ts
  • Loading branch information
kpunwatk committed Sep 5, 2023
1 parent 11b4394 commit cded685
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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 () {
Expand Down

0 comments on commit cded685

Please sign in to comment.