Skip to content

Commit

Permalink
chore: benchmark script
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Nov 12, 2024
1 parent faa8249 commit a56d6ab
Show file tree
Hide file tree
Showing 7 changed files with 4,435 additions and 15,765 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"test:integration:legacy:since:release": "yarn test:e2e:legacy:since:release",
"test:protocols": "yarn build:protocols && lerna run test --scope '@aws-sdk/aws-protocoltests-*'",
"test:server-protocols": "yarn build:server-protocols && lerna run test --scope '@aws-sdk/*-server'",
"test:size": "cd scripts/benchmark-size/runner && yarn && ts-node ./cli.ts",
"test:size": "cd scripts/benchmark-size/runner && yarn && npx tsx ./cli.ts",
"test:unit": "make test-unit",
"test:versions": "jest --config tests/versions/jest.config.js tests/versions/index.spec.ts",
"update:versions:default": "node --es-module-specifier-resolution=node ./scripts/update-versions/default.mjs",
Expand Down Expand Up @@ -102,7 +102,7 @@
"rimraf": "3.0.2",
"ts-jest": "29.1.1",
"ts-loader": "9.4.2",
"ts-node": "10.9.1",
"tsx": "4.19.2",
"turbo": "2.1.2",
"typescript": "~4.9.5",
"verdaccio": "5.25.0",
Expand Down
1 change: 1 addition & 0 deletions scripts/benchmark-size/runner/local-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const localPublishChangedPackages = async (): Promise<string> => {
console.info(`the package versions will be the actual version up with a patch version and preid "ci".`);
await exec("yarn", ["local-publish"], {
cwd: PROJECT_ROOT,
stdio: "inherit",
});
console.info(`published ${readdirSync(join(PROJECT_ROOT, "verdaccio", "storage", "@aws-sdk")).length} packages`);
return join(PROJECT_ROOT, "verdaccio", "config.yaml");
Expand Down
6 changes: 1 addition & 5 deletions scripts/benchmark-size/runner/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
{
"compilerOptions": {
"module": "ESNext", // to run ts-node with ESM dependencies
"module": "ESNext",
"target": "ESNext",
"moduleResolution": "node",
"allowSyntheticDefaultImports": true
},
"ts-node": {
// Tell ts-node CLI to install the --loader automatically, explained below
"esm": true
}
}
6 changes: 3 additions & 3 deletions scripts/benchmark-size/runner/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export const sleep = (ms: number) =>

export const validateRuntime = async () => {
try {
await exec("yarn", ["--version"]);
await exec("npx", ["--version"]);
} catch (e) {
console.error("yarn is not available, please install yarn globally");
console.error("npx is not available, please install npx globally");
throw e;
}
try {
await exec("yarn", ["--silent", "lerna", "--version"], {
await exec("npx", ["lerna", "--version"], {
cwd: PROJECT_ROOT,
});
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/benchmark-size/runner/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const loadWorkspacePackages = async (options?: {
}
}

const { stdout } = await exec("yarn", ["--silent", "lerna", ...args], {
const { stdout } = await exec("npx", ["lerna", ...args], {
cwd: PROJECT_ROOT,
encoding: "utf8",
});
Expand Down
3,785 changes: 2,541 additions & 1,244 deletions scripts/benchmark-size/runner/yarn.lock

Large diffs are not rendered by default.

Loading

0 comments on commit a56d6ab

Please sign in to comment.