Initial Portal Runner (#51)

This commit is contained in:
Steve Faulkner
2020-06-24 14:07:01 -05:00
committed by GitHub
parent d22cb598a9
commit 3bf42b23dd
14 changed files with 7613 additions and 773 deletions

15
test/utils.js Normal file
View File

@@ -0,0 +1,15 @@
let client;
const appInsightsKey = process.env.PORTAL_RUNNER_APP_INSIGHTS_KEY;
if (!appInsightsKey) {
console.warn(`PORTAL_RUNNER_APP_INSIGHTS_KEY env var not set. Runner telemetry will not be reported`);
} else {
const appInsights = require("applicationinsights");
appInsights.setup(process.env.PORTAL_RUNNER_APP_INSIGHTS_KEY).start();
client = appInsights.defaultClient;
}
module.exports.trackEvent = (...args) => {
if (client) {
client.trackEvent(...args);
}
};