Gate integration tests of unrebuilt Enterprise features behind pending-rebuild; record what v0.16.22 proved
This commit is contained in:
@@ -4,6 +4,10 @@ version = "0.16.22"
|
||||
edition = "2024"
|
||||
|
||||
[features]
|
||||
# Tests for Enterprise features the fork hasn't rebuilt yet. Off by default, so
|
||||
# the crate compiles without them. Each gate is marked `inbuxa: pending-rebuild`,
|
||||
# and comes off when its feature's rebuild lands.
|
||||
pending-rebuild = []
|
||||
#default = ["sqlite", "postgres", "mysql", "rocks", "s3", "redis", "nats", "azure", "foundationdb"]
|
||||
#default = ["sqlite", "postgres", "mysql", "rocks", "s3", "redis", "foundationdb"]
|
||||
default = ["rocks", "sqlite"]
|
||||
|
||||
@@ -15,6 +15,7 @@ pub mod unavailable;
|
||||
#[tokio::test(flavor = "multi_thread")]
|
||||
pub async fn directory_tests() {
|
||||
ldap::test().await;
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
oidc::test().await;
|
||||
unavailable::test().await;
|
||||
discovery::test().await;
|
||||
|
||||
@@ -4,6 +4,12 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
use common::enterprise::llm::{
|
||||
ChatCompletionChoice, ChatCompletionRequest, ChatCompletionResponse, Message,
|
||||
};
|
||||
#[cfg(feature = "pending-rebuild")]
|
||||
use spam_filter::analysis::llm::SpamFilterAnalyzeLlm;
|
||||
use crate::utils::{
|
||||
dns::DnsCache,
|
||||
http_server::{HttpMessage, spawn_mock_http_server},
|
||||
@@ -14,9 +20,6 @@ use common::{
|
||||
Server,
|
||||
auth::{AccountCache, AccountInfo},
|
||||
config::mailstore::spamfilter::SpamFilterAction,
|
||||
enterprise::llm::{
|
||||
ChatCompletionChoice, ChatCompletionRequest, ChatCompletionResponse, Message,
|
||||
},
|
||||
};
|
||||
use http_proto::{JsonResponse, ToHttpResponse};
|
||||
use hyper::Method;
|
||||
@@ -46,7 +49,7 @@ use spam_filter::{
|
||||
dmarc::SpamFilterAnalyzeDmarc, domain::SpamFilterAnalyzeDomain,
|
||||
ehlo::SpamFilterAnalyzeEhlo, from::SpamFilterAnalyzeFrom,
|
||||
headers::SpamFilterAnalyzeHeaders, html::SpamFilterAnalyzeHtml, init::SpamFilterInit,
|
||||
ip::SpamFilterAnalyzeIp, llm::SpamFilterAnalyzeLlm, messageid::SpamFilterAnalyzeMid,
|
||||
ip::SpamFilterAnalyzeIp, messageid::SpamFilterAnalyzeMid,
|
||||
mime::SpamFilterAnalyzeMime, pyzor::SpamFilterAnalyzePyzor,
|
||||
received::SpamFilterAnalyzeReceived, recipient::SpamFilterAnalyzeRecipient,
|
||||
replyto::SpamFilterAnalyzeReplyTo, rules::SpamFilterAnalyzeRules,
|
||||
@@ -220,6 +223,7 @@ async fn antispam() {
|
||||
}
|
||||
|
||||
// Spawn mock OpenAI server
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
let _tx = spawn_mock_http_server(
|
||||
&test,
|
||||
Arc::new(|req: HttpMessage| {
|
||||
@@ -289,6 +293,10 @@ async fn antispam() {
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// inbuxa: pending-rebuild. The LLM case needs the AI classifier rebuilt.
|
||||
if cfg!(not(feature = "pending-rebuild")) && test_name == "llm" {
|
||||
continue;
|
||||
}
|
||||
|
||||
println!("===== {test_name} =====");
|
||||
let contents = fs::read_to_string(base_path.join(format!("{test_name}.test"))).unwrap();
|
||||
@@ -657,6 +665,7 @@ async fn antispam() {
|
||||
"pyzor" => {
|
||||
server.spam_filter_analyze_pyzor(&mut spam_ctx).await;
|
||||
}
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
"llm" => {
|
||||
server.spam_filter_analyze_llm(&mut spam_ctx).await;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ pub async fn system_tests() {
|
||||
authentication::test(&test).await;
|
||||
oidc::test(&mut test).await;
|
||||
authorization::test(&mut test).await;
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/multi-tenancy.md
|
||||
tenant::test(&mut test).await;
|
||||
security::test(&mut test).await;
|
||||
quota::test(&mut test).await;
|
||||
@@ -67,6 +68,7 @@ pub async fn system_tests() {
|
||||
delivery::test(&mut test).await;
|
||||
crypto::test(&mut test).await;
|
||||
antispam::test(&mut test).await;
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/undelete.md
|
||||
archiving::test(&mut test).await;
|
||||
task::test(&mut test).await;
|
||||
|
||||
|
||||
@@ -4,9 +4,13 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
pub mod alerts;
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
pub mod metrics;
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
pub mod tracing;
|
||||
#[cfg(feature = "pending-rebuild")] // inbuxa: pending-rebuild, see docs/spec/features/
|
||||
pub mod webhooks;
|
||||
|
||||
use crate::utils::server::TestServerBuilder;
|
||||
@@ -55,9 +59,13 @@ pub async fn telemetry_tests() {
|
||||
.await;
|
||||
test.insert_account(admin);
|
||||
|
||||
#[cfg(feature = "pending-rebuild")]
|
||||
alerts::test(&test).await;
|
||||
#[cfg(feature = "pending-rebuild")]
|
||||
metrics::test(&test).await;
|
||||
#[cfg(feature = "pending-rebuild")]
|
||||
tracing::test(&test).await;
|
||||
#[cfg(feature = "pending-rebuild")]
|
||||
webhooks::test(&test).await;
|
||||
|
||||
if test.is_reset() {
|
||||
|
||||
Reference in New Issue
Block a user