Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions AISKU/Tests/Perf/src/AISKUPerf.Tests.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { AITestClass, Assert } from "@microsoft/ai-test-framework";
import { AppInsightsInitPerfTestClass } from "./AISKUPerf";
import { utlRemoveSessionStorage } from "@microsoft/applicationinsights-common";
import { createTimeoutPromise, doAwait } from "@nevware21/ts-async";

function isNullOrUndefined(value: any): boolean {
return value === undefined || value === null;
Expand Down Expand Up @@ -165,11 +166,10 @@ export class AISKUPerf extends AITestClass {
}

public addPerfTest(): void {
this.testCaseAsync({
this.testCase({
name: "AppInsights AISKU perf Test",
stepDelay: 10000,
assertNoHooks: false,
steps: [() => {
test: () => {
Assert.ok(window["appInsightsInitPerftest"], "global appInsightsInitPerftest exists");
Assert.ok(window["oneDS"], "oneDS exists");
Assert.ok(this.perfMgr, "perfMgr exists");
Expand All @@ -195,9 +195,11 @@ export class AISKUPerf extends AITestClass {
Assert.ok(false, "load snippet error: " + e);
}

}].concat(() => {
Assert.ok(true, "test version: " + this.AISKUPerfTest.version);
})
// Wait for 10 seconds to allow the script to load and then check if the appInsights object is available
return this._delay(10000, () => {
Assert.ok(true, "test version: " + this.AISKUPerfTest.version);
});
}
});
}

Expand Down
22 changes: 11 additions & 11 deletions AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any).concat(PollingAssert.createPollingAssert(() => {
}, "Wait for promise response" + new Date().toISOString(), 60) as any).concat(PollingAssert.createPollingAssert(() => {
let core = this._ai.core
let activeStatus = core.activeStatus && core.activeStatus();

Expand All @@ -325,7 +325,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for new string response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for new string response" + new Date().toISOString(), 60) as any)
});

this.testCaseAsync({
Expand Down Expand Up @@ -380,7 +380,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for promise response" + new Date().toISOString(), 60) as any)
});


Expand Down Expand Up @@ -443,7 +443,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for promise response" + new Date().toISOString(), 60) as any)
});


Expand Down Expand Up @@ -484,7 +484,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for promise response" + new Date().toISOString(), 60) as any)
});

this.testCaseAsync({
Expand Down Expand Up @@ -538,7 +538,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for promise response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for promise response" + new Date().toISOString(), 60) as any)
});


Expand Down Expand Up @@ -783,7 +783,7 @@ export class ApplicationInsightsTests extends AITestClass {
return false;
}
return false;
}, "Wait for response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for response" + new Date().toISOString(), 60) as any)
});

this.testCaseAsync({
Expand Down Expand Up @@ -836,7 +836,7 @@ export class ApplicationInsightsTests extends AITestClass {
return false;
}
return false;
}, "Wait for response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for response" + new Date().toISOString(), 60) as any)
});

this.testCaseAsync({
Expand Down Expand Up @@ -871,7 +871,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true;
}
return false;
}, "Wait for response" + new Date().toISOString(), 60, 1000) as any)
}, "Wait for response" + new Date().toISOString(), 60) as any)
});
}

Expand Down Expand Up @@ -910,7 +910,7 @@ export class ApplicationInsightsTests extends AITestClass {
return true
}
return false
}, "Wait for init" + new Date().toISOString(), 60, 1000) as any).concat(this.asserts(1)).concat(() => {
}, "Wait for init" + new Date().toISOString(), 60) as any).concat(this.asserts(1)).concat(() => {
const payloadStr: string[] = this.getPayloadMessages(this.successSpy);
if (payloadStr.length > 0) {
const payload = JSON.parse(payloadStr[0]);
Expand Down Expand Up @@ -2023,7 +2023,7 @@ export class ApplicationInsightsTests extends AITestClass {
}

return false;
}, "sender succeeded", 60, 1000))
}, "sender succeeded", 60))
];
}

Expand Down
Loading
Loading