Configuration¶
Slash uses a hierarchical configuration structure provided by Confetti. The configuration values are addressed by their full path (e.g. debug.enabled
, meaning the value called ‘enabled’ under the branch ‘debug’).
Note
You can inspect the current paths, defaults and docs for Slash’s configuration via the slash list-config
command from your shell
Several ways exist to modify configuration values.
Overriding Configuration Values via Command-Line¶
When running tests via slash run
, you can use the -o
flag to override configuration values:
$ slash run -o hooks.swallow_exceptions=yes ...
Note
Configuration values get automatically converted to their respective types. More specifically, boolean values also recognize yes
and no
as valid values.
Customization Files¶
There are several locations in which you can store files that are to be automatically executed by Slash when it runs. These files can contain code that overrides configuration values:
- slashrc file
If the file
~/.slash/slashrc
(See run.user_customization_file_path) exists, it is loaded and executed as a regular Python file by Slash on startup.- SLASH_USER_SETTINGS
If an environment variable named
SLASH_USER_SETTINGS
exists, the file path it points to will be loaded instead of the slashrc file.- SLASH_SETTINGS
If an environment variable named
SLASH_SETTINGS
exists, it is assumed to point at a file path or URL to load as a regular Python file on startup.
Each of these files can contain code which, among other things, can modify Slash’s configuration. The configuration object is located in slash.config
, and modified through slash.config.root
as follows:
# ~/.slash/slashrc contents
import slash
slash.config.root.debug.enabled = False
List of Available Configuration Values¶
debug.debug_skips¶
Default: FalseEnter pdb also for SkipTest exceptions
debug.debug_hook_handlers¶
Default: FalseEnter pdb also for every exception encountered in a hook/callback. Only relevant when debugging is enabled
debug.enabled¶
Default: FalseEnter pdb on failures and errors
debug.filter_strings¶
Default: []A string filter, selecting if to enter pdb
debug.debugger¶
Default: Nonelog.colorize¶
Default: FalseEmit log colors to files
log.console_theme.dark_background¶
Default: Truelog.console_theme.inline-file-end-fail¶
Default: redlog.console_theme.inline-file-end-skip¶
Default: yellowlog.console_theme.inline-file-end-success¶
Default: greenlog.console_theme.inline-error¶
Default: redlog.console_theme.inline-test-interrupted¶
Default: yellowlog.console_theme.error-cause-marker¶
Default: white/boldlog.console_theme.fancy-message¶
Default: yellow/boldlog.console_theme.frame-local-varname¶
Default: yellow/boldlog.console_theme.num-collected¶
Default: white/boldlog.console_theme.session-summary-success¶
Default: green/boldlog.console_theme.session-summary-failure¶
Default: red/boldlog.console_theme.session-start¶
Default: white/boldlog.console_theme.error-separator-dash¶
Default: redlog.console_theme.tb-error-message¶
Default: red/boldlog.console_theme.tb-error¶
Default: red/boldlog.console_theme.tb-frame-location¶
Default: white/boldlog.console_theme.test-additional-details-header¶
Default: black/boldlog.console_theme.test-additional-details¶
Default: black/boldlog.console_theme.test-error-header¶
Default: whitelog.console_theme.test-skip-message¶
Default: yellowlog.console_theme.tb-line-cause¶
Default: whitelog.console_theme.tb-test-line¶
Default: red/boldlog.console_theme.tb-line¶
Default: black/boldlog.console_level¶
Default: 13log.core_log_level¶
Default: 13Minimal level of slash log messages to show
log.color_console¶
Default: Nonelog.repr_blacklisted_types¶
Default: []Blacklisted types that should not be repred in traceback
log.traceback_variables¶
Default: FalseLogs values of variables in traceback frames for added errors
log.console_traceback_level¶
Default: 2Detail level of tracebacks
log.truncate_console_lines¶
Default: Truetruncate long log lines on the console
log.truncate_console_errors¶
Default: FalseIf truncate_console_lines is set, also truncate long log lines, including and above the “error” level, on the console
log.root¶
Default: NoneRoot directory for logs
log.subpath¶
Default: {context.session.id}/{context.test_id}/debug.logPath to write logs to under the root
log.session_subpath¶
Default: {context.session.id}/session.loglog.highlights_subpath¶
Default: NoneIf set, this path will be used to record highlights (eg. errors added) in the session and/or tests
log.last_session_symlink¶
Default: NoneIf set, specifies a symlink path to the last session log file in each run
log.last_session_dir_symlink¶
Default: NoneIf set, specifies a symlink path to the last session log directory
log.last_test_symlink¶
Default: NoneIf set, specifies a symlink path to the last test log file in each run
log.last_failed_symlink¶
Default: NoneIf set, specifies a symlink path to the last failed test log file
log.show_manual_errors_tb¶
Default: TrueShow tracebacks for errors added via slash.add_error
log.show_raw_param_values¶
Default: FalseMakes test start logs contain the raw values of test parameters
log.silence_loggers¶
Default: []Logger names to silence
log.format¶
Default: NoneFormat of the log line, as passed on to logbook. None will use the default format
log.console_format¶
Default: NoneOptional format to be used for console output. Defaults to the regular format
log.localtime¶
Default: FalseUse local time for logging. If False, will use UTC
log.unittest_mode¶
Default: FalseUsed during unit testing. Emit all logs to stderr as well as the log files
log.unified_session_log¶
Default: FalseMake the session log file contain all logs, including from tests
log.compression.enabled¶
Default: FalseCompress log files
log.compression.algorithm¶
Default: brotliCompression algorithm to use, either gzip or brotli
log.compression.use_rotating_raw_file¶
Default: FalseWhen compression is enabled, write also to uncompressed rotating log file
log.cleanup.enabled¶
Default: Falselog.cleanup.keep_failed¶
Default: Truerun.dump_variation¶
Default: FalseOutput the full variation structure before each test is run (mainly used for internal debugging)
run.default_sources¶
Default: []Default tests to run assuming no other sources are given to the runner
run.suite_files¶
Default: []File(s) to be read for lists of tests to be run
run.stop_on_error¶
Default: FalseStop execution when a test doesn’t succeed
run.filter_strings¶
Default: []A string filter, selecting specific tests by string matching against their name
run.repeat_each¶
Default: 1Repeat each test a specified amount of times
run.repeat_all¶
Default: 1Repeat all suite a specified amount of times
run.session_state_path¶
Default: ~/.slash/last_sessionWhere to keep last session serialized data
run.project_name¶
Default: Nonerun.project_customization_file_path¶
Default: ./.slashrcrun.user_customization_file_path¶
Default: ~/.slash/slashrcrun.resume_state_path¶
Default: ~/.slash/session_statesPath to store or load session’s resume data
run.message_assertion_introspection¶
Default: TrueWhen False, failing assertions which have messages attached will not emit introspection info
run.capture.error_logs_as_errors¶
Default: FalseAdd errors for error level logs
interactive.expose_g_globals¶
Default: TrueWhen False, slash.g won’t be added to interactive test namespaces
interactive.colors¶
Default: NoneIPython color scheme
parallel.num_workers¶
Default: 0Parallel execution
parallel.worker_id¶
Default: NoneWorker_id
parallel.server_addr¶
Default: localhostServer address
parallel.server_port¶
Default: 0Server port
parallel.keepalive_port¶
Default: 0Keepalive port
parallel.parent_session_id¶
Default: Noneparent session id
parallel.communication_timeout_secs¶
Default: 60timeout of worker in seconds
parallel.worker_connect_timeout¶
Default: 10timeout for each worker to connect
parallel.no_request_timeout¶
Default: 20timeout for server not getting requests
parallel.worker_error_file¶
Default: errors-workerworker error filename template
parallel.workers_error_dir¶
Default: Noneworkers error directory
resume.failed_first¶
Default: FalseRun failed tests of previous session before all others
resume.unstarted_first¶
Default: FalseRun unstarted tests of previous session before all others
resume.failed_only¶
Default: FalseRun only failed tests of previous session
resume.unstarted_only¶
Default: FalseRun only unstarted tests of previous session
resume.no_skipped¶
Default: FalseRun tests of previous session without skipped tests
resume.state_retention_days¶
Default: 10Number of days to keep session entries for resuming session
tmux.enabled¶
Default: FalseRun inside tmux
tmux.use_panes¶
Default: FalseIn parallel mode, run children inside panes and not windows
sentry.dsn¶
Default: NonePossible DSN for a sentry service to log swallowed exceptions. See http://getsentry.com for details
plugins.search_paths¶
Default: []List of paths in which to search for plugin modules
plugin_config.coverage.config_filename¶
Default: FalseCoverage configuration file
plugin_config.coverage.report_type¶
Default: htmlCoverage report format
plugin_config.coverage.report¶
Default: Trueplugin_config.coverage.append¶
Default: FalseAppend coverage data to existing file
plugin_config.coverage.sources¶
Default: []Modules or packages for which to track coverage
plugin_config.ci_links.build_url_environment_variable¶
Default: BUILD_URLplugin_config.ci_links.link_template¶
Default: %(build_url)s/artifact/%(log_path)splugin_config.notifications.prowl_api_key¶
Default: Noneplugin_config.notifications.nma_api_key¶
Default: Noneplugin_config.notifications.pushbullet_api_key¶
Default: Noneplugin_config.notifications.notification_threshold¶
Default: 5plugin_config.notifications.notify_only_on_failures¶
Default: Falseplugin_config.notifications.notify_on_pdb¶
Default: Trueplugin_config.notifications.prowl.api_key¶
Default: Noneplugin_config.notifications.prowl.enabled¶
Default: Trueplugin_config.notifications.nma.api_key¶
Default: Noneplugin_config.notifications.nma.enabled¶
Default: Trueplugin_config.notifications.pushbullet.api_key¶
Default: Noneplugin_config.notifications.pushbullet.enabled¶
Default: Trueplugin_config.notifications.email.from_email¶
Default: Slash <noreply@getslash.github.io>plugin_config.notifications.email.smtp_server¶
Default: Noneplugin_config.notifications.email.to_list¶
Default: []plugin_config.notifications.email.cc_list¶
Default: []plugin_config.notifications.email.enabled¶
Default: Falseplugin_config.notifications.slack.url¶
Default: Noneplugin_config.notifications.slack.channel¶
Default: Noneplugin_config.notifications.slack.from_user¶
Default: slash-botplugin_config.notifications.slack.enabled¶
Default: Falseplugin_config.xunit.filename¶
Default: testsuite.xmlName of XML xUnit file to create