diff --git a/crates/wright-driver/src/config.rs b/crates/wright-driver/src/config.rs index 33d6554..f620666 100644 --- a/crates/wright-driver/src/config.rs +++ b/crates/wright-driver/src/config.rs @@ -125,9 +125,10 @@ pub struct SessionConfig { /// [`CompilerSession::language_provider`] spawns a provider client for a /// language id from this registry; when no provider is configured the /// refusal is explicit and there is no fallback to in-process frontends. - /// The registry is empty by default; `wright_lpp::ProviderRegistry` - /// documents the configuration (and the `LPP_MOCK_PROVIDER` env hook - /// used by tests and CI). + /// The registry is empty by default; providers are registered explicitly + /// through `wright_lpp::ProviderRegistry` (integration tests and CI + /// locate the mock provider through the `LPP_MOCK_PROVIDER` + /// environment variable). pub providers: wright_lpp::ProviderRegistry, } diff --git a/crates/wright-lpp/src/registry.rs b/crates/wright-lpp/src/registry.rs index be8b22c..ad6d06d 100644 --- a/crates/wright-lpp/src/registry.rs +++ b/crates/wright-lpp/src/registry.rs @@ -15,10 +15,6 @@ use std::time::Duration; use crate::error::ProviderError; use crate::provider::StdioLanguageProvider; -/// The environment variable naming the LPP mock/conformance provider binary -/// used by integration tests and CI. -pub const LPP_MOCK_PROVIDER_ENV: &str = "LPP_MOCK_PROVIDER"; - /// One configured provider, keyed by its opaque language id. #[derive(Debug, Clone)] pub struct ProviderConfig { @@ -47,12 +43,6 @@ impl ProviderConfig { request_timeout: Duration::from_secs(30), } } - - /// Set an explicit per-request timeout. - pub fn with_request_timeout(mut self, request_timeout: Duration) -> ProviderConfig { - self.request_timeout = request_timeout; - self - } } /// A registry error. @@ -99,16 +89,6 @@ impl ProviderRegistry { Ok(()) } - /// The configuration registered for a language id, if any. - pub fn get(&self, language_id: &str) -> Option<&ProviderConfig> { - self.providers.get(language_id) - } - - /// Every registered language id, in deterministic order. - pub fn languages(&self) -> impl Iterator { - self.providers.keys().map(String::as_str) - } - /// Spawn a fresh provider session for `language_id`. /// /// Refuses explicitly when no provider is configured for the id @@ -123,22 +103,4 @@ impl ProviderRegistry { })?; StdioLanguageProvider::spawn(&config.command, &config.args, config.request_timeout) } - - /// A registry populated from the environment: `LPP_MOCK_PROVIDER` names - /// a mock/conformance provider binary serving the reference language - /// `x-demo-lang`. This is the integration-test/CI hook; production - /// configuration registers providers explicitly. - pub fn from_env() -> ProviderRegistry { - let mut registry = ProviderRegistry::new(); - if let Ok(command) = std::env::var(LPP_MOCK_PROVIDER_ENV) { - if !command.is_empty() { - let _ = registry.register(ProviderConfig::new( - "x-demo-lang", - PathBuf::from(command), - Vec::new(), - )); - } - } - registry - } } diff --git a/crates/wright-lpp/tests/mock_provider.rs b/crates/wright-lpp/tests/mock_provider.rs index ee30ae9..a271c94 100644 --- a/crates/wright-lpp/tests/mock_provider.rs +++ b/crates/wright-lpp/tests/mock_provider.rs @@ -170,10 +170,6 @@ fn registry_lookup_is_by_opaque_language_id() { language_id: "x-other-lang".to_string(), } ); - assert_eq!( - registry.languages().collect::>(), - vec![DEMO_LANGUAGE_ID] - ); } // --------------------------------------------------------------------------- @@ -506,14 +502,11 @@ fn missing_capability_is_an_explicit_refusal_not_a_fallback() { }; let mut registry = ProviderRegistry::new(); registry - .register( - ProviderConfig::new( - DEMO_LANGUAGE_ID, - path, - vec!["--without".to_string(), "compile".to_string()], - ) - .with_request_timeout(std::time::Duration::from_secs(30)), - ) + .register(ProviderConfig::new( + DEMO_LANGUAGE_ID, + path, + vec!["--without".to_string(), "compile".to_string()], + )) .expect("registered"); let mut provider = registry.spawn(DEMO_LANGUAGE_ID).expect("spawns"); let result = provider