Struct nextest_runner::config::NextestConfig
source · pub struct NextestConfig { /* private fields */ }Expand description
Overall configuration for nextest.
This is the root data structure for nextest configuration. Most runner-specific configuration is managed
through profiles, obtained through the profile method.
For more about configuration, see Configuration in the nextest book.
Implementations§
source§impl NextestConfig
impl NextestConfig
sourcepub const CONFIG_PATH: &'static str = ".config/nextest.toml"
pub const CONFIG_PATH: &'static str = ".config/nextest.toml"
The default location of the config within the path: .config/nextest.toml, used to read the
config from the given directory.
sourcepub const DEFAULT_CONFIG: &'static str = "# This is the default config used by nextest. It is embedded in the binary at\n# build time. It may be used as a template for .config/nextest.toml.\n\n[store]\n# The directory under the workspace root at which nextest-related files are\n# written. Profile-specific storage is currently written to dir/<profile-name>.\ndir = \"target/nextest\"\n\n# This section defines the default nextest profile. Custom profiles are layered\n# on top of the default profile.\n[profile.default]\n# \"retries\" defines the number of times a test should be retried. If set to a\n# non-zero value, tests that succeed on a subsequent attempt will be marked as\n# non-flaky. Can be overridden through the `--retries` option.\n# Examples\n# * retries = 3\n# * retries = { backoff = \"fixed\", count = 2, delay = \"1s\" }\n# * retries = { backoff = \"exponential\", count = 10, delay = \"1s\", jitter = true, max-delay = \"10s\" }\nretries = 0\n\n# The number of threads to run tests with. Supported values are either an integer or\n# the string \"num-cpus\". Can be overridden through the `--test-threads` option.\ntest-threads = \"num-cpus\"\n\n# The number of threads required for each test. This is generally used in overrides to\n# mark certain tests as heavier than others. However, it can also be set as a global parameter.\nthreads-required = 1\n\n# Show these test statuses in the output.\n#\n# The possible values this can take are:\n# * none: no output\n# * fail: show failed (including exec-failed) tests\n# * retry: show flaky and retried tests\n# * slow: show slow tests\n# * pass: show passed tests\n# * skip: show skipped tests (most useful for CI)\n# * all: all of the above\n#\n# Each value includes all the values above it; for example, \"slow\" includes\n# failed and retried tests.\n#\n# Can be overridden through the `--status-level` flag.\nstatus-level = \"pass\"\n\n# Similar to status-level, show these test statuses at the end of the run.\nfinal-status-level = \"flaky\"\n\n# \"failure-output\" defines when standard output and standard error for failing tests are produced.\n# Accepted values are\n# * \"immediate\": output failures as soon as they happen\n# * \"final\": output failures at the end of the test run\n# * \"immediate-final\": output failures as soon as they happen and at the end of\n# the test run; combination of \"immediate\" and \"final\"\n# * \"never\": don\'t output failures at all\n#\n# For large test suites and CI it is generally useful to use \"immediate-final\".\n#\n# Can be overridden through the `--failure-output` option.\nfailure-output = \"immediate\"\n\n# \"success-output\" controls production of standard output and standard error on success. This should\n# generally be set to \"never\".\nsuccess-output = \"never\"\n\n# Cancel the test run on the first failure. For CI runs, consider setting this\n# to false.\nfail-fast = true\n\n# Treat a test that takes longer than the configured \'period\' as slow, and print a message.\n# See <https://nexte.st/book/slow-tests> for more information.\n#\n# Optional: specify the parameter \'terminate-after\' with a non-zero integer,\n# which will cause slow tests to be terminated after the specified number of\n# periods have passed.\n# Example: slow-timeout = { period = \"60s\", terminate-after = 2 }\nslow-timeout = { period = \"60s\" }\n\n# Treat a test as leaky if after the process is shut down, standard output and standard error\n# aren\'t closed within this duration.\n#\n# This usually happens in case of a test that creates a child process and lets it inherit those\n# handles, but doesn\'t clean the child process up (especially when it fails).\n#\n# See <https://nexte.st/book/leaky-tests> for more information.\nleak-timeout = \"100ms\"\n\n[profile.default.junit]\n# Output a JUnit report into the given file inside \'store.dir/<profile-name>\'.\n# If unspecified, JUnit is not written out.\n\n# path = \"junit.xml\"\n\n# The name of the top-level \"report\" element in JUnit report. If aggregating\n# reports across different test runs, it may be useful to provide separate names\n# for each report.\nreport-name = \"nextest-run\"\n\n# Whether standard output and standard error for passing tests should be stored in the JUnit report.\n# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.\nstore-success-output = false\n\n# Whether standard output and standard error for failing tests should be stored in the JUnit report.\n# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.\n#\n# Note that if a description can be extracted from the output, it is always stored in the\n# <description> element.\nstore-failure-output = true\n\n# This profile is activated if MIRI_SYSROOT is set.\n[profile.default-miri]\n# Miri tests take up a lot of memory, so only run 1 test at a time by default.\ntest-threads = 1\n"
pub const DEFAULT_CONFIG: &'static str = "# This is the default config used by nextest. It is embedded in the binary at\n# build time. It may be used as a template for .config/nextest.toml.\n\n[store]\n# The directory under the workspace root at which nextest-related files are\n# written. Profile-specific storage is currently written to dir/<profile-name>.\ndir = \"target/nextest\"\n\n# This section defines the default nextest profile. Custom profiles are layered\n# on top of the default profile.\n[profile.default]\n# \"retries\" defines the number of times a test should be retried. If set to a\n# non-zero value, tests that succeed on a subsequent attempt will be marked as\n# non-flaky. Can be overridden through the `--retries` option.\n# Examples\n# * retries = 3\n# * retries = { backoff = \"fixed\", count = 2, delay = \"1s\" }\n# * retries = { backoff = \"exponential\", count = 10, delay = \"1s\", jitter = true, max-delay = \"10s\" }\nretries = 0\n\n# The number of threads to run tests with. Supported values are either an integer or\n# the string \"num-cpus\". Can be overridden through the `--test-threads` option.\ntest-threads = \"num-cpus\"\n\n# The number of threads required for each test. This is generally used in overrides to\n# mark certain tests as heavier than others. However, it can also be set as a global parameter.\nthreads-required = 1\n\n# Show these test statuses in the output.\n#\n# The possible values this can take are:\n# * none: no output\n# * fail: show failed (including exec-failed) tests\n# * retry: show flaky and retried tests\n# * slow: show slow tests\n# * pass: show passed tests\n# * skip: show skipped tests (most useful for CI)\n# * all: all of the above\n#\n# Each value includes all the values above it; for example, \"slow\" includes\n# failed and retried tests.\n#\n# Can be overridden through the `--status-level` flag.\nstatus-level = \"pass\"\n\n# Similar to status-level, show these test statuses at the end of the run.\nfinal-status-level = \"flaky\"\n\n# \"failure-output\" defines when standard output and standard error for failing tests are produced.\n# Accepted values are\n# * \"immediate\": output failures as soon as they happen\n# * \"final\": output failures at the end of the test run\n# * \"immediate-final\": output failures as soon as they happen and at the end of\n# the test run; combination of \"immediate\" and \"final\"\n# * \"never\": don\'t output failures at all\n#\n# For large test suites and CI it is generally useful to use \"immediate-final\".\n#\n# Can be overridden through the `--failure-output` option.\nfailure-output = \"immediate\"\n\n# \"success-output\" controls production of standard output and standard error on success. This should\n# generally be set to \"never\".\nsuccess-output = \"never\"\n\n# Cancel the test run on the first failure. For CI runs, consider setting this\n# to false.\nfail-fast = true\n\n# Treat a test that takes longer than the configured \'period\' as slow, and print a message.\n# See <https://nexte.st/book/slow-tests> for more information.\n#\n# Optional: specify the parameter \'terminate-after\' with a non-zero integer,\n# which will cause slow tests to be terminated after the specified number of\n# periods have passed.\n# Example: slow-timeout = { period = \"60s\", terminate-after = 2 }\nslow-timeout = { period = \"60s\" }\n\n# Treat a test as leaky if after the process is shut down, standard output and standard error\n# aren\'t closed within this duration.\n#\n# This usually happens in case of a test that creates a child process and lets it inherit those\n# handles, but doesn\'t clean the child process up (especially when it fails).\n#\n# See <https://nexte.st/book/leaky-tests> for more information.\nleak-timeout = \"100ms\"\n\n[profile.default.junit]\n# Output a JUnit report into the given file inside \'store.dir/<profile-name>\'.\n# If unspecified, JUnit is not written out.\n\n# path = \"junit.xml\"\n\n# The name of the top-level \"report\" element in JUnit report. If aggregating\n# reports across different test runs, it may be useful to provide separate names\n# for each report.\nreport-name = \"nextest-run\"\n\n# Whether standard output and standard error for passing tests should be stored in the JUnit report.\n# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.\nstore-success-output = false\n\n# Whether standard output and standard error for failing tests should be stored in the JUnit report.\n# Output is stored in the <system-out> and <system-err> elements of the <testcase> element.\n#\n# Note that if a description can be extracted from the output, it is always stored in the\n# <description> element.\nstore-failure-output = true\n\n# This profile is activated if MIRI_SYSROOT is set.\n[profile.default-miri]\n# Miri tests take up a lot of memory, so only run 1 test at a time by default.\ntest-threads = 1\n"
Contains the default config as a TOML file.
Repository-specific configuration is layered on top of the default config.
sourcepub const ENVIRONMENT_PREFIX: &'static str = "NEXTEST"
pub const ENVIRONMENT_PREFIX: &'static str = "NEXTEST"
Environment configuration uses this prefix, plus a _.
sourcepub const DEFAULT_PROFILE: &'static str = "default"
pub const DEFAULT_PROFILE: &'static str = "default"
The name of the default profile.
sourcepub const DEFAULT_MIRI_PROFILE: &'static str = "default-miri"
pub const DEFAULT_MIRI_PROFILE: &'static str = "default-miri"
The name of the default profile used for miri.
sourcepub const DEFAULT_PROFILES: &'static [&'static str] = _
pub const DEFAULT_PROFILES: &'static [&'static str] = _
A list containing the names of the Nextest defined reserved profile names.
sourcepub fn from_sources<'a, I>(
workspace_root: impl Into<Utf8PathBuf>,
graph: &PackageGraph,
config_file: Option<&Utf8Path>,
tool_config_files: impl IntoIterator<IntoIter = I>,
experimental: &BTreeSet<ConfigExperimental>
) -> Result<Self, ConfigParseError>
pub fn from_sources<'a, I>( workspace_root: impl Into<Utf8PathBuf>, graph: &PackageGraph, config_file: Option<&Utf8Path>, tool_config_files: impl IntoIterator<IntoIter = I>, experimental: &BTreeSet<ConfigExperimental> ) -> Result<Self, ConfigParseError>
Reads the nextest config from the given file, or if not specified from .config/nextest.toml
in the workspace root.
tool_config_files are lower priority than config_file but higher priority than the
default config. Files in tool_config_files that come earlier are higher priority than those
that come later.
If no config files are specified and this file doesn’t have .config/nextest.toml, uses the
default config options.
sourcepub fn profile(
&self,
name: impl AsRef<str>
) -> Result<NextestProfile<'_, PreBuildPlatform>, ProfileNotFound>
pub fn profile( &self, name: impl AsRef<str> ) -> Result<NextestProfile<'_, PreBuildPlatform>, ProfileNotFound>
Returns the profile with the given name, or an error if a profile was specified but not found.
Trait Implementations§
source§impl Clone for NextestConfig
impl Clone for NextestConfig
source§fn clone(&self) -> NextestConfig
fn clone(&self) -> NextestConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for NextestConfig
impl Send for NextestConfig
impl Sync for NextestConfig
impl Unpin for NextestConfig
impl UnwindSafe for NextestConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<D> OwoColorize for D
impl<D> OwoColorize for D
source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
source§fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>
source§fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>
source§fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>
source§fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>
source§fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>
source§fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>
source§fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>
source§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
source§fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>
source§fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>
source§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
source§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
source§fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>
source§fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>
source§fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>
source§fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>
source§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
source§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
source§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
source§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
source§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
source§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
source§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
source§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
source§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
source§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
source§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
source§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
source§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
source§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
source§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
source§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
source§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
source§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
source§fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>
source§fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>
source§fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>
source§fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>
source§fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
fn blink<'a>(&'a self) -> BlinkDisplay<'a, Self>
source§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
source§fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>
source§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moresource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more