Storage: k6 tests (#57496)
* object store k6 * update script * refactor * rename scripts * fix paths * fixes * fix client - check connected state * add teardown timeout * rename to grpc object store client * fail if health check fails * abort rather than fail * stale import * create `run.sh` * adjust for dummy server * fix mkdir * clean up dependencies * remove name and version * bring back name and version! * remove clean webpackk plugin * remove copy plugin * update yarn lock * remove stale import * update yarn lock * move perf tests to devenv/docker/loadtest-ts * add codeownres
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { readdirSync, writeFileSync, mkdirSync } from 'fs';
|
||||
import { dirname, resolve } from 'path';
|
||||
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
if (args.length !== 2) {
|
||||
throw new Error('expected dev dashboards dir and the output file path');
|
||||
}
|
||||
|
||||
const devDashboardsDir = args[0];
|
||||
const outputFilePath = args[1];
|
||||
|
||||
const getFiles = (dirPath: string, ext?: string): string[] =>
|
||||
readdirSync(dirPath, { withFileTypes: true })
|
||||
.flatMap((dirEntry) => {
|
||||
const res = resolve(dirPath, dirEntry.name);
|
||||
return dirEntry.isDirectory() ? getFiles(res) : res;
|
||||
})
|
||||
.filter((path) => (ext?.length ? path.endsWith(ext) : true));
|
||||
|
||||
const files = getFiles(devDashboardsDir, '.json');
|
||||
|
||||
mkdirSync(dirname(outputFilePath), { recursive: true });
|
||||
writeFileSync(outputFilePath, JSON.stringify(files, null, 2));
|
||||
Reference in New Issue
Block a user