Skip to content

chore: remove orphaned pytest config-generation code - #3775

Merged
haiyuechen-nearone merged 1 commit into
mainfrom
3773-remove-pytest-dead-code
Jul 14, 2026
Merged

chore: remove orphaned pytest config-generation code#3775
haiyuechen-nearone merged 1 commit into
mainfrom
3773-remove-pytest-dead-code

Conversation

@haiyuechen-nearone

Copy link
Copy Markdown
Contributor

Closes #3773

Pure dead-code removal. The generate-test-configs subcommand and its scaffolding were only ever invoked by the pytest suite removed in #3076; nothing in the current tree calls it, and it lived behind #[cfg(feature = "test-utils")] so it was never in production binaries.

Removes:

  • the GenerateTestConfigs CLI command + match arm and the testing module in cli.rs
  • the CLI_FOR_PYTEST port seed and the now-dead TOTAL_DEFINED_PORTS constant in p2p.rs
  • the unused p2p_keypairs parameter of generate_test_p2p_configs (the testing module was its only Some(...) caller; all four remaining callers passed None)

The test-utils feature stays (still used by keyshare.rs, migration_service/web.rs, p2p::testing, and backup-cli). generate_test_p2p_configs remains and is still exercised by the mpc-node cluster/integration tests, which pass.

The generate-test-configs subcommand and its scaffolding were only ever
invoked by the removed pytest suite (#3076). Removes the CLI command and
its testing module, the CLI_FOR_PYTEST port seed, the now-dead
TOTAL_DEFINED_PORTS constant, and the unused p2p_keypairs parameter of
generate_test_p2p_configs.
@haiyuechen-nearone haiyuechen-nearone self-assigned this Jul 13, 2026
@haiyuechen-nearone
haiyuechen-nearone marked this pull request as ready for review July 13, 2026 07:11
@claude

claude Bot commented Jul 13, 2026

Copy link
Copy Markdown

Pull request overview

Pure dead-code removal following the pytest suite removal in #3076. Deletes the GenerateTestConfigs CLI subcommand and its testing module in cli.rs, drops the unused CLI_FOR_PYTEST port seed and dead TOTAL_DEFINED_PORTS constant in p2p.rs, and prunes the always-None p2p_keypairs parameter from generate_test_p2p_configs along with its four callers.

Changes:

  • Remove CliCommand::GenerateTestConfigs variant and its match arm
  • Remove the #[cfg(feature = "test-utils")] mod testing in cli.rs (config-file generation, duplicate_migrating_accounts, create_file_config)
  • Remove PortSeed::CLI_FOR_PYTEST and PortSeed::TOTAL_DEFINED_PORTS
  • Simplify generate_test_p2p_configs by inlining the keypair generation and dropping the p2p_keypairs: Option<Vec<SigningKey>> argument
  • Update the four remaining callers (three in p2p.rs tests, one in tests.rs)

Reviewed changes

Per-file summary
File Description
crates/node/src/cli.rs Drops the GenerateTestConfigs subcommand, its match arm, and the entire testing submodule that generated per-node MPC config files.
crates/node/src/p2p.rs Removes the CLI_FOR_PYTEST port seed, the stale TOTAL_DEFINED_PORTS constant, and the p2p_keypairs param from generate_test_p2p_configs; updates three in-file test callers.
crates/node/src/tests.rs Updates IntegrationTestSetup to call generate_test_p2p_configs without the removed None argument.

Findings

Verified:

  • No remaining references to GenerateTestConfigs, run_generate_test_configs, CLI_FOR_PYTEST, or TOTAL_DEFINED_PORTS anywhere in .rs/.toml/.py/.sh/.md sources (only a historical entry in CHANGELOG.md:2371, which is correct to leave alone).
  • All seven callers of generate_test_p2p_configs (in p2p.rs and tests.rs) are updated; no other call sites in the workspace.
  • The test-utils feature on the node crate is still load-bearing (used to gate keyshare::test_utils, migration_service/web::test_utils, p2p::testing, and consumed by backup-cli).
  • PortSeed::TOTAL_PORTS_PER_NODE (=4, still used in compute_port) is unrelated to the removed TOTAL_DEFINED_PORTS (=23) — the latter was purely descriptive and unreferenced.
  • Behavior of the four remaining callers is unchanged: all previously passed None, which took the same branch that now runs unconditionally.

No blocking or non-blocking issues found.

✅ Approved

@pbeza
pbeza requested a review from Copilot July 14, 2026 11:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes leftover mpc-node CLI and P2P testing scaffolding that previously supported the (now-removed) pytest-based cluster, and simplifies the remaining Rust test configuration helper API.

Changes:

  • Removes the GenerateTestConfigs CLI subcommand and its #[cfg(feature = "test-utils")] scaffolding module from cli.rs.
  • Removes now-unused PortSeed::CLI_FOR_PYTEST and the unused TOTAL_DEFINED_PORTS constant from p2p::testing.
  • Simplifies p2p::testing::generate_test_p2p_configs by dropping the unused p2p_keypairs parameter and updating in-tree call sites accordingly.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/node/src/cli.rs Removes the orphaned GenerateTestConfigs command and its supporting test-config generation module.
crates/node/src/p2p.rs Removes pytest-specific port seed/constants and simplifies generate_test_p2p_configs’s signature/implementation.
crates/node/src/tests.rs Updates integration test setup to call the updated generate_test_p2p_configs signature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/node/src/p2p.rs
Comment on lines 1021 to 1024
// this is a hack to make sure that when tests run in parallel, they don't
// collide on the same port.
port_seed: PortSeed,
// Supply `Some` value here if you want to use pre-existing p2p key pairs
p2p_keypairs: Option<Vec<SigningKey>>,
) -> anyhow::Result<Vec<(MpcConfig, SigningKey)>> {
Merged via the queue into main with commit 2195ba3 Jul 14, 2026
20 checks passed
@haiyuechen-nearone
haiyuechen-nearone deleted the 3773-remove-pytest-dead-code branch July 14, 2026 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove orphaned generate-test-configs command and CLI_FOR_PYTEST port seed left after pytest removal

4 participants