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# 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"
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# 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"
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<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request
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(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, 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