Skip to content

feat: timeout#1292

Draft
tonyfettes wants to merge 1 commit intomoonbitlang:mainfrom
tonyfettes:haoxiang/test-timeout
Draft

feat: timeout#1292
tonyfettes wants to merge 1 commit intomoonbitlang:mainfrom
tonyfettes:haoxiang/test-timeout

Conversation

@tonyfettes
Copy link
Copy Markdown
Contributor

Summary

This PR closes #1290, adding timeout support in moon test command line and moon.pkg.json configuration file.

Metadata

  • Tests added/updated for bug fixes or new features
  • Compatible with Windows/Linux/macOS

@semanticdiff-com
Copy link
Copy Markdown

semanticdiff-com Bot commented Dec 8, 2025

Review changes with  SemanticDiff

Changed Files
File Status
  crates/moon/src/cli/check.rs  89% smaller
  crates/moon/src/run/child.rs  37% smaller
  crates/moon/src/cli/test.rs  25% smaller
  crates/moon/src/cli/run.rs  0% smaller
  crates/moon/src/run/runtest.rs  0% smaller
  crates/moonbuild-rupes-recta/src/discover/synth.rs  0% smaller
  crates/moonbuild/src/bench.rs  0% smaller
  crates/moonutil/src/common.rs  0% smaller
  crates/moonutil/src/package.rs  0% smaller
  crates/moonutil/src/scan.rs  0% smaller

@tonyfettes tonyfettes force-pushed the haoxiang/test-timeout branch from 1fc4485 to fef11b2 Compare December 10, 2025 09:31
@peter-jerry-ye
Copy link
Copy Markdown
Contributor

@codex Review?

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fef11b2d3b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +365 to +369
/// Test timeout in seconds
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(alias = "test-timeout")]
#[schemars(rename = "test-timeout")]
pub test_timeout: Option<u64>,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Regenerate schema snapshots after adding test-timeout

Adding MoonPkgJSON::test_timeout changes the generated package schema, but this change does not include the corresponding regenerated artifacts (crates/moonbuild/template/pkg.schema.json and the manual schema HTML files) that validate_pkg_json_schema checks in crates/moonutil/src/package.rs; this will make that test fail once CI runs and leaves user-facing schema docs out of sync with the code.

Useful? React with 👍 / 👎.

Comment on lines +1494 to +1500
let test_timeout = cmd.timeout.or_else(|| {
// Try to get timeout from the first package's configuration
build_meta
.resolve_output
.pkg_dirs
.all_packages()
.next()
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Resolve timeout from selected packages, not first package

When --timeout is omitted, this code takes test_timeout from pkg_dirs.all_packages().next(), so in multi-package projects (or with --package filters) the timeout can come from an unrelated package and then be applied globally to all test executables; this makes moon.pkg.json timeout behavior incorrect for any package that is not first in discovery order.

Useful? React with 👍 / 👎.

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.

timeout support for moon test

2 participants