File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import (
2121 "context"
2222 "encoding/json"
2323 "errors"
24+ "os"
2425 "regexp"
2526 "strings"
2627 "sync"
@@ -314,6 +315,14 @@ func defaultLoader(
314315 )
315316 clientOptions = append (clientOptions , client .WithOdpManager (odpManager ))
316317
318+ // Configure CMAB prediction endpoint from environment variable
319+ // This allows FSC tests to override the endpoint by setting OPTIMIZELY_CMAB_PREDICTIONENDPOINT
320+ if cmabEndpoint := os .Getenv ("OPTIMIZELY_CMAB_PREDICTIONENDPOINT" ); cmabEndpoint != "" {
321+ // Set the global variable that go-sdk uses (same pattern as go-sdk FSC tests)
322+ cmab .CMABPredictionEndpoint = cmabEndpoint + "/%s"
323+ log .Info ().Str ("endpoint" , cmabEndpoint ).Msg ("Using custom CMAB prediction endpoint" )
324+ }
325+
317326 // Parse CMAB cache configuration
318327 cacheSize := cmab .DefaultCacheSize
319328 cacheTTL := cmab .DefaultCacheTTL
You can’t perform that action at this time.
0 commit comments