PromucFlow_constructor/app/client/perf/src/index.js
Satish Gandham 4bff451735
chore: persist performance test results (#11208)
* Persist performance run data to supabase

* Remove stray comment

Co-authored-by: Satish Gandham <satish@appsmith.com>
2022-02-16 19:55:33 +05:30

24 lines
834 B
JavaScript

const glob = require("glob");
const path = require("path");
const { summaries } = require("./summary");
const { saveToSupabase } = require("./ci/supabase");
var cp = require("child_process");
var fs = require("fs");
// Create the directory
global.APP_ROOT = path.join(__dirname, ".."); //Going back one level from src folder to /perf
const dir = `${APP_ROOT}/traces/reports`;
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir, { recursive: true });
}
glob("./tests/*.perf.js", {}, async function(er, files) {
// Initial setup
await cp.execSync(`node ./tests/initial-setup.js`, { stdio: "inherit" });
files.forEach(async (file) => {
await cp.execSync(`node ${file}`, { stdio: "inherit" }); // Logging to terminal, log it to a file in future?
});
await summaries(`${APP_ROOT}/traces/reports`);
await saveToSupabase();
});