@@ -106,3 +106,64 @@ func TestBundleWithS3Storage(t *testing.T) {
106106 require .NoError (t , err , "Bundle should shutdown cleanly" )
107107 t .Log ("Bundle shutdown complete" )
108108}
109+
110+ // TestBundleWithS3CustomRegion verifies that the bundle works with MinIO
111+ // configured with a custom region. This tests the fix for GitHub issue #47.
112+ func TestBundleWithS3CustomRegion (t * testing.T ) {
113+ ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Minute )
114+ defer cancel ()
115+
116+ customRegion := "custom-test-region"
117+
118+ // Start MongoDB
119+ mongo , err := StartMongo (ctx )
120+ require .NoError (t , err , "Failed to start MongoDB" )
121+ defer mongo .Terminate (ctx )
122+ t .Logf ("MongoDB URI: %s" , mongo .URI )
123+
124+ // Start Redis
125+ redis , err := StartRedis (ctx )
126+ require .NoError (t , err , "Failed to start Redis" )
127+ defer redis .Terminate (ctx )
128+ t .Logf ("Redis URI: %s" , redis .URI )
129+
130+ // Start MinIO with custom region
131+ minio , err := StartMinIOWithRegion (ctx , customRegion )
132+ require .NoError (t , err , "Failed to start MinIO with custom region" )
133+ defer minio .Terminate (ctx )
134+ t .Logf ("MinIO Endpoint: %s, Region: %s" , minio .Endpoint , minio .Region )
135+
136+ // Start bundle with S3 and matching region
137+ bundle , err := StartBundle (ctx , BundleConfig {
138+ MongoURI : mongo .URI ,
139+ RedisURI : redis .URI ,
140+ S3Bucket : "anytype-data" ,
141+ S3Endpoint : minio .Endpoint ,
142+ S3Region : customRegion ,
143+ S3AccessKey : minio .AccessKey ,
144+ S3SecretKey : minio .SecretKey ,
145+ })
146+ require .NoError (t , err , "Failed to start bundle" )
147+ defer bundle .Cleanup ()
148+ defer bundle .Stop ()
149+
150+ // Wait for ready
151+ err = bundle .WaitReady (90 * time .Second )
152+ require .NoError (t , err , "Bundle should become ready with custom S3 region" )
153+ t .Log ("Bundle is ready" )
154+
155+ // Verify S3 backend selected
156+ err = bundle .WaitForS3Backend (5 * time .Second )
157+ require .NoError (t , err , "S3 storage backend should be selected" )
158+ t .Log ("S3 storage backend confirmed" )
159+
160+ // Verify TCP port
161+ err = bundle .VerifyPort ("33010" )
162+ require .NoError (t , err , "Port 33010 should be listening" )
163+ t .Log ("Port 33010 is listening" )
164+
165+ // Graceful shutdown
166+ err = bundle .Stop ()
167+ require .NoError (t , err , "Bundle should shutdown cleanly" )
168+ t .Log ("Bundle shutdown complete" )
169+ }
0 commit comments