diff --git a/dsl/types/utils.go b/dsl/types/utils.go index 545ab0b4..b889eb8e 100644 --- a/dsl/types/utils.go +++ b/dsl/types/utils.go @@ -111,7 +111,7 @@ func DetectType(path string) Type { return TypeModel case "conn": return TypeConnector - case "lru", "redis", "mongo", "badger": + case "lru", "redis", "mongo", "xun": return TypeStore } @@ -187,7 +187,7 @@ func TypeRootAndExts(typ Type) (string, []string) { case TypeAIGC: return "aigcs", []string{".ai.yao", ".ai.jsonc", ".ai.json"} case TypeStore: - return "stores", []string{".lru.yao", ".redis.yao", ".mongo.yao", ".badger.yao", ".store.yao", ".store.jsonc", ".store.json"} + return "stores", []string{".lru.yao", ".redis.yao", ".mongo.yao", ".xun.yao", ".store.yao", ".store.jsonc", ".store.json"} default: return "", []string{} } diff --git a/dsl/types/utils_test.go b/dsl/types/utils_test.go index f3659e41..4d737280 100644 --- a/dsl/types/utils_test.go +++ b/dsl/types/utils_test.go @@ -257,11 +257,6 @@ func TestDetectType(t *testing.T) { path: filepath.Join("stores", "cache.mongo.yao"), want: TypeStore, }, - { - name: "Store Badger", - path: filepath.Join("stores", "cache.badger.yao"), - want: TypeStore, - }, { name: "Store by extension", path: filepath.Join("stores", "cache.store.yao"), @@ -510,7 +505,7 @@ func TestTypeRootAndExts(t *testing.T) { name: "Store", typ: TypeStore, wantRoot: "stores", - wantExts: []string{".lru.yao", ".redis.yao", ".mongo.yao", ".badger.yao", ".store.yao", ".store.jsonc", ".store.json"}, + wantExts: []string{".lru.yao", ".redis.yao", ".mongo.yao", ".xun.yao", ".store.yao", ".store.jsonc", ".store.json"}, }, { name: "Unknown", diff --git a/openapi/oauth/TESTING_GUIDE.md b/openapi/oauth/TESTING_GUIDE.md index 264612e5..f7aac09f 100644 --- a/openapi/oauth/TESTING_GUIDE.md +++ b/openapi/oauth/TESTING_GUIDE.md @@ -9,7 +9,7 @@ This guide provides comprehensive testing infrastructure for OAuth 2.1 authoriza ### Core Components - **OAuth Service Configuration**: Complete OAuth 2.1 configuration with all features enabled -- **Store Management**: Support for MongoDB and Badger stores with automatic fallback +- **Store Management**: Support for MongoDB and Xun (database-backed) stores with automatic fallback - **Test Data Sets**: Pre-configured clients and users for comprehensive testing - **Environment Setup**: Standardized initialization and cleanup procedures @@ -110,7 +110,7 @@ source $YAO_SOURCE_ROOT/env.local.sh func setupOAuthTestEnvironment(t *testing.T) (*Service, store.Store, store.Store, func()) { // Creates complete OAuth test environment with: // - Configured OAuth service with all features enabled - // - Primary store (MongoDB preferred, Badger fallback) + // - Primary store (MongoDB preferred, Xun database fallback) // - Cache store (LRU cache) // - Pre-loaded test clients and users // - Cleanup function for proper teardown @@ -325,7 +325,7 @@ export MONGO_TEST_PASS=test ### Common Issues -1. **Store Connection**: Check MongoDB availability or use Badger fallback +1. **Store Connection**: Check MongoDB availability or use Xun (database) fallback 2. **Environment Setup**: Ensure `env.local.sh` is sourced 3. **Test Timeouts**: Increase timeout for slow operations 4. **Data Conflicts**: ✅ **RESOLVED** - Now automatically handled with unique test suffixes @@ -361,7 +361,7 @@ Tests include comprehensive logging: ### Performance Considerations - **MongoDB**: Preferred for full feature testing -- **Badger**: Fast fallback for basic testing +- **Xun**: Database-backed fallback with LRU cache layer - **Cache**: LRU cache for improved performance - **Cleanup**: Efficient cleanup procedures diff --git a/openapi/oauth/oauth_test.go b/openapi/oauth/oauth_test.go index ac92829d..76b7e32e 100644 --- a/openapi/oauth/oauth_test.go +++ b/openapi/oauth/oauth_test.go @@ -331,7 +331,7 @@ func setupOAuthTestEnvironment(t *testing.T) (*Service, store.Store, store.Store // Get store configurations storeConfigs := getStoreConfigs() - // Use the first available store (prefer MongoDB, fallback to Badger) + // Use the first available store (prefer MongoDB, fallback to Xun) var mainStore store.Store var storeConfig StoreConfig