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

source

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.

source

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.

source

pub const ENVIRONMENT_PREFIX: &'static str = "NEXTEST"

Environment configuration uses this prefix, plus a _.

source

pub const DEFAULT_PROFILE: &'static str = "default"

The name of the default profile.

source

pub const DEFAULT_MIRI_PROFILE: &'static str = "default-miri"

The name of the default profile used for miri.

source

pub const DEFAULT_PROFILES: &'static [&'static str] = _

A list containing the names of the Nextest defined reserved profile names.

source

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.

source

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

source§

fn clone(&self) -> NextestConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for NextestConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<D> OwoColorize for D

source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
source§

fn if_supports_color<'a, Out, ApplyFn>( &'a self, stream: impl Into<Stream>, apply: ApplyFn ) -> SupportsColorsDisplay<'a, Self, Out, ApplyFn>
where ApplyFn: Fn(&'a Self) -> Out,

Apply a given transformation function to all formatters if the given stream supports at least basic ANSI colors, allowing you to conditionally apply given styles/colors. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more