Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.
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
24 changes: 9 additions & 15 deletions src/bot/parse/guessCommand.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ const dataProvider: DataProvider[] = [
result: "bot sample --input=args",
},
{
suitName: "cumulus assets polkadot",
command: "bench $ pallet asset-hub-polkadot assets pallet_xz",
suitName: "cumulus assets westend",
command: "bench $ pallet asset-hub-westend assets pallet_xz",
repo: "polkadot-sdk",
result: "bot bench cumulus-assets --pallet=pallet_xz",
},
{
suitName: "cumulus assets kusama",
suitName: "cumulus assets will end up with default as kusama no longer in repo",
command: "bench $ pallet asset-hub-kusama assets pallet_xz",
repo: "polkadot-sdk",
result: "bot bench cumulus-assets --runtime=asset-hub-kusama --pallet=pallet_xz",
result: "bot bench cumulus-assets --pallet=pallet_name",
},
{
suitName: "cumulus assets old kusama: will endup with default, as can't find `statemine`",
Expand All @@ -53,20 +53,14 @@ const dataProvider: DataProvider[] = [
repo: "polkadot-sdk",
result: "bot bench polkadot-pallet --pallet=pallet_contracts",
},
{ suitName: "polkadot all", command: "bench-all $ kusama", repo: "polkadot", result: "bot bench-all polkadot" },
{ suitName: "polkadot all", command: "bench-all $ rococo", repo: "polkadot", result: "bot bench-all polkadot" },
{
suitName: "cumulus bridge-hubs",
command: "bench $ xcm bridge-hub-kusama bridge-hubs pallet_name",
suitName: "cumulus bridge-hubs default",
command: "bench $ xcm bridge-hub-rococo bridge-hubs pallet_name",
repo: "cumulus",
result: "bot bench cumulus-bridge-hubs --subcommand=xcm --runtime=bridge-hub-kusama --pallet=pallet_name",
},
{
suitName: "try-runtime default",
command: "try-runtime $ westend",
repo: "polkadot",
result: "bot try-runtime --chain=westend",
result: "bot bench cumulus-bridge-hubs --subcommand=xcm --pallet=pallet_name",
},
{ suitName: "try-runtime default", command: "try-runtime $ polkadot", repo: "polkadot", result: "bot try-runtime" },
{ suitName: "try-runtime default", command: "try-runtime $ westend", repo: "polkadot", result: "bot try-runtime" },
];

describe("guessCommand", () => {
Expand Down
16 changes: 8 additions & 8 deletions src/bot/parse/parsePullRequestBotCommandLine.namedArgs.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,21 @@ const dataProvider: DataProvider[] = [
gitlab: { job: { tags: ["weights-vm"], variables: {} } },
},
{},
'"$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=runtime --runtime=polkadot --target_dir=polkadot --pallet=pallet_referenda',
'"$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=runtime --runtime=westend --target_dir=polkadot --pallet=pallet_referenda',
),
},
{
suitName: "bench-bot cumulus",
commandLine:
"bot bench cumulus-bridge-hubs -v PIPELINE_SCRIPTS_REF=branch --subcommand=xcm --runtime=bridge-hub-kusama --pallet=pallet_name",
"bot bench cumulus-bridge-hubs -v PIPELINE_SCRIPTS_REF=branch --subcommand=xcm --runtime=bridge-hub-rococo --pallet=pallet_name",
expectedResponse: new GenericCommand(
"bench",
{
commandStart: ['"$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh"'],
gitlab: { job: { tags: ["weights-vm"], variables: {} } },
},
{ PIPELINE_SCRIPTS_REF: "branch" },
'"$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=xcm --runtime=bridge-hub-kusama --runtime_dir=bridge-hubs --target_dir=cumulus --pallet=pallet_name',
'"$PIPELINE_SCRIPTS_DIR/commands/bench/bench.sh" --subcommand=xcm --runtime=bridge-hub-rococo --runtime_dir=bridge-hubs --target_dir=cumulus --pallet=pallet_name',
),
repo: "cumulus",
},
Expand All @@ -53,15 +53,15 @@ const dataProvider: DataProvider[] = [
},
{
suitName: "try-runtime-bot testing default without mentioning preset name",
commandLine: "bot try-runtime -v RUST_LOG=remote-ext=debug,runtime=trace -v SECOND=val --chain=kusama",
commandLine: "bot try-runtime -v RUST_LOG=remote-ext=debug,runtime=trace -v SECOND=val --chain=rococo",
expectedResponse: new GenericCommand(
"try-runtime",
{
commandStart: ['"$PIPELINE_SCRIPTS_DIR/commands/try-runtime/try-runtime.sh"'],
gitlab: { job: { tags: ["linux-docker-vm-c2"], variables: {} } },
},
{ RUST_LOG: "remote-ext=debug,runtime=trace", SECOND: "val" },
'"$PIPELINE_SCRIPTS_DIR/commands/try-runtime/try-runtime.sh" --chain=kusama --target_path=. --chain_node=polkadot',
'"$PIPELINE_SCRIPTS_DIR/commands/try-runtime/try-runtime.sh" --chain=rococo --target_path=. --chain_node=polkadot',
),
},
{
Expand All @@ -74,7 +74,7 @@ const dataProvider: DataProvider[] = [
gitlab: { job: { tags: ["linux-docker-vm-c2"], variables: {} } },
},
{},
'"$PIPELINE_SCRIPTS_DIR/commands/try-runtime/try-runtime.sh" --chain=polkadot --target_path=. --chain_node=polkadot',
'"$PIPELINE_SCRIPTS_DIR/commands/try-runtime/try-runtime.sh" --chain=westend --target_path=. --chain_node=polkadot',
),
},
{
Expand Down Expand Up @@ -311,9 +311,9 @@ const dataProvider: DataProvider[] = [
},
{
suitName: "non existed config must return error with explanation",
commandLine: "bot bench-overhead $ kusama",
commandLine: "bot bench-overhead $ rococo",
expectedResponse: new Error(
`Positional arguments are not supported anymore. I guess you meant \`bot bench-overhead --runtime=kusama\`, but I could be wrong.\n[Read docs](http://cmd-bot.docs.com/static/docs/latest.html) to find out how to run your command.`,
`Positional arguments are not supported anymore. I guess you meant \`bot bench-overhead --runtime=rococo\`, but I could be wrong.\n[Read docs](http://cmd-bot.docs.com/static/docs/latest.html) to find out how to run your command.`,
),
},
];
Expand Down
23 changes: 10 additions & 13 deletions src/command-configs/__mocks__/fetchCommandsConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export const cmd: CommandConfigs = {
description: "Pallet + Overhead Benchmark for Polkadot",
repos: ["polkadot", "polkadot-sdk"],
args: {
runtime: { label: "Runtime", type_one_of: ["kusama", "polkadot", "rococo", "westend"] },
runtime: { label: "Runtime", type_one_of: ["rococo", "westend"] },
target_dir: { label: "Target Directory", type_string: "polkadot" },
},
},
Expand Down Expand Up @@ -64,7 +64,7 @@ export const cmd: CommandConfigs = {
description: "Runs `benchmark overhead` and commits back to PR the updated `extrinsic_weights.rs` files",
repos: ["polkadot", "polkadot-sdk"],
args: {
runtime: { label: "Runtime", type_one_of: ["polkadot", "kusama", "rococo", "westend"] },
runtime: { label: "Runtime", type_one_of: ["westend", "rococo"] },
target_dir: { label: "Target Directory", type_string: "polkadot" },
},
},
Expand All @@ -77,7 +77,7 @@ export const cmd: CommandConfigs = {
description: "Runs `benchmark overhead` and commits back to PR the updated `extrinsic_weights.rs` files",
repos: ["cumulus", "polkadot-sdk"],
args: {
runtime: { label: "Runtime", type_one_of: ["asset-hub-polkadot", "asset-hub-kusama", "asset-hub-westend"] },
runtime: { label: "Runtime", type_one_of: ["asset-hub-westend"] },
target_dir: { label: "Target Directory", type_string: "cumulus" },
},
},
Expand Down Expand Up @@ -113,7 +113,7 @@ export const cmd: CommandConfigs = {
repos: ["polkadot", "command-bot-test", "polkadot-sdk"],
args: {
subcommand: { label: "Subcommand", type_one_of: ["runtime", "xcm"] },
runtime: { label: "Runtime", type_one_of: ["polkadot", "kusama", "rococo", "westend"] },
runtime: { label: "Runtime", type_one_of: ["westend", "rococo"] },
pallet: { label: "Pallet", type_rule: "^([a-z_]+)([:]{2}[a-z_]+)?$", example: "pallet_name" },
target_dir: { label: "Target Directory", type_string: "polkadot" },
},
Expand All @@ -123,7 +123,7 @@ export const cmd: CommandConfigs = {
repos: ["cumulus", "polkadot-sdk"],
args: {
subcommand: { label: "Subcommand", type_one_of: ["pallet", "xcm"] },
runtime: { label: "Runtime", type_one_of: ["asset-hub-polkadot", "asset-hub-kusama", "asset-hub-westend"] },
runtime: { label: "Runtime", type_one_of: ["asset-hub-westend"] },
pallet: { label: "Pallet", type_rule: "^([a-z_]+)([:]{2}[a-z_]+)?$", example: "pallet_name" },
runtime_dir: { label: "Runtime Dir", type_string: "assets" },
target_dir: { label: "Target Directory", type_string: "cumulus" },
Expand All @@ -134,7 +134,7 @@ export const cmd: CommandConfigs = {
repos: ["cumulus", "polkadot-sdk"],
args: {
subcommand: { label: "Subcommand", type_one_of: ["pallet", "xcm"] },
runtime: { label: "Runtime", type_one_of: ["collectives-polkadot"] },
runtime: { label: "Runtime", type_one_of: ["collectives-westend"] },
pallet: { label: "Pallet", type_rule: "^([a-z_]+)([:]{2}[a-z_]+)?$", example: "pallet_name" },
runtime_dir: { label: "Runtime Dir", type_string: "collectives" },
target_dir: { label: "Target Directory", type_string: "cumulus" },
Expand All @@ -145,10 +145,7 @@ export const cmd: CommandConfigs = {
repos: ["cumulus", "polkadot-sdk"],
args: {
subcommand: { label: "Subcommand", type_one_of: ["pallet", "xcm"] },
runtime: {
label: "Runtime",
type_one_of: ["bridge-hub-polkadot", "bridge-hub-kusama", "bridge-hub-rococo"],
},
runtime: { label: "Runtime", type_one_of: ["bridge-hub-rococo"] },
pallet: { label: "Pallet", type_rule: "^([a-z_]+)([:]{2}[a-z_]+)?$", example: "pallet_name" },
runtime_dir: { label: "Runtime Dir", type_string: "bridge-hubs" },
target_dir: { label: "Target Directory", type_string: "cumulus" },
Expand All @@ -170,7 +167,7 @@ export const cmd: CommandConfigs = {
repos: ["cumulus", "polkadot-sdk"],
args: {
subcommand: { label: "Subcommand", type_one_of: ["pallet"] },
runtime: { label: "Runtime", type_one_of: ["glutton-kusama", "glutton-kusama-dev-1300"] },
runtime: { label: "Runtime", type_one_of: ["glutton-westend", "glutton-westend-dev-1300"] },
pallet: { label: "Pallet", type_rule: "^([a-z_]+)([:]{2}[a-z_]+)?$", example: "pallet_name" },
runtime_dir: { label: "Runtime Dir", type_string: "glutton" },
target_dir: { label: "Target Directory", type_string: "cumulus" },
Expand Down Expand Up @@ -276,7 +273,7 @@ export const cmd: CommandConfigs = {
description: "Run try-runtime with specified runtime for Polkadot repo",
repos: ["polkadot", "command-bot-test"],
args: {
chain: { label: "Chain", type_one_of: ["polkadot", "kusama", "westend", "rococo"] },
chain: { label: "Chain", type_one_of: ["westend", "rococo"] },
target_path: { label: "Target Path", type_string: "." },
chain_node: { label: "Chain Node", type_string: "polkadot" },
},
Expand All @@ -285,7 +282,7 @@ export const cmd: CommandConfigs = {
description: "Run try-runtime with specified runtime for monorepo Polkadot SDK",
repos: ["polkadot-sdk"],
args: {
chain: { label: "Chain", type_one_of: ["polkadot", "kusama", "westend", "rococo"] },
chain: { label: "Chain", type_one_of: ["westend", "rococo"] },
target_path: { label: "Target Path", type_string: "./polkadot" },
chain_node: { label: "Chain Node", type_string: "polkadot" },
},
Expand Down