Skip to main content

Module test_workers

Module test_workers 

Source
Expand description

Test worker configuration loading for true E2E tests.

This module handles loading and validating worker configurations specifically for end-to-end testing scenarios that require real SSH-accessible worker machines.

§Configuration File

Tests use the configuration in tests/true_e2e/workers_test.toml. Override with the RCH_E2E_WORKERS_CONFIG environment variable.

§Example Configuration

[settings]
default_timeout_secs = 300
ssh_connection_timeout_secs = 10
remote_work_dir = "/tmp/rch_test"

[[workers]]
id = "test-worker"
host = "192.168.1.100"
user = "ubuntu"
identity_file = "~/.ssh/id_rsa"
total_slots = 16
enabled = true

Structs§

TestSettings
Test-specific settings for E2E tests.
TestWorkerEntry
Single worker entry in test configuration.
TestWorkersConfig
Complete test worker configuration.

Enums§

TestConfigError
Error type for configuration operations.

Constants§

DEFAULT_CONFIG_PATH
Default config file path relative to workspace root.
ENV_SKIP_ALL_TESTS
Environment variable to skip all true E2E tests.
ENV_SKIP_WORKER_CHECK
Environment variable to skip worker availability checks.
ENV_TIMEOUT_SECS
Environment variable to override command timeout.
ENV_WORKERS_CONFIG
Environment variable to override config file location.

Functions§

expand_tilde_path
Expand tilde (~) in a path to the user’s home directory.
get_config_path
Get the configuration file path, considering environment override.
is_mock_ssh_mode
Check if mock SSH mode is enabled (for CI testing without real workers).
require_workers
Load worker config and verify at least one reachable worker. Returns None when tests should be skipped, with structured logs explaining why.
should_skip_all_tests
Check if all true E2E tests should be skipped.
should_skip_worker_check
Check if worker availability checks should be skipped.

Type Aliases§

TestConfigResult
Result type for configuration operations.