()
| 54 | } |
| 55 | |
| 56 | func NewTestExternalServiceManager() *TestExternalServiceManager { |
| 57 | pool, err := dockertest.NewPool("") |
| 58 | pool.MaxWait = 10 * time.Second |
| 59 | if err != nil { |
| 60 | panic(err) |
| 61 | } |
| 62 | err = pool.Client.Ping() |
| 63 | if err != nil { |
| 64 | panic(err) |
| 65 | } |
| 66 | s3Config := &TestS3Config{ |
| 67 | Bucket: "test-bucket", |
| 68 | Access: "minio", |
| 69 | Secret: "minio123", |
| 70 | Port: "", |
| 71 | } |
| 72 | dbConfig := &db.DBConfigDef{ |
| 73 | POSTGRES_DB: "imgdd_test", |
| 74 | POSTGRES_PASSWORD: "imgdd_test", |
| 75 | POSTGRES_USER: "imgdd_test", |
| 76 | POSTGRES_HOST: "localhost", |
| 77 | POSTGRES_PORT: "", |
| 78 | } |
| 79 | webDavConfig := &TestWebDAVConfig{ |
| 80 | Username: "test", |
| 81 | Password: "test", |
| 82 | Port: "", |
| 83 | } |
| 84 | ipfsMfsConfig := &TestIPFSMFSConfig{ |
| 85 | ApiPort: "", |
| 86 | } |
| 87 | return &TestExternalServiceManager{ |
| 88 | Pool: pool, |
| 89 | dbResource: nil, |
| 90 | redisResource: nil, |
| 91 | minioResource: nil, |
| 92 | s3Config: s3Config, |
| 93 | dbConfig: dbConfig, |
| 94 | webDavConfig: webDavConfig, |
| 95 | ipfsMfsConfig: ipfsMfsConfig, |
| 96 | logger: logging.GetLogger("TESM"), |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | func (ts *TestExternalServiceManager) StartPostgres() { |
| 101 | ts.lock.Lock() |
no test coverage detected