GetNonDefaultDatastoreNames returns a list of non-default datastore names from the given bucket.
(t testing.TB, bucket Bucket)
| 976 | |
| 977 | // GetNonDefaultDatastoreNames returns a list of non-default datastore names from the given bucket. |
| 978 | func GetNonDefaultDatastoreNames(t testing.TB, bucket Bucket) []sgbucket.DataStoreName { |
| 979 | allDataStoreNames, err := bucket.ListDataStores() |
| 980 | require.NoError(t, err) |
| 981 | var keyspaces []string |
| 982 | for _, name := range allDataStoreNames { |
| 983 | if IsDefaultCollection(name.ScopeName(), name.CollectionName()) { |
| 984 | continue |
| 985 | } |
| 986 | keyspaces = append(keyspaces, fmt.Sprintf("%s.%s", name.ScopeName(), name.CollectionName())) |
| 987 | } |
| 988 | sort.Strings(keyspaces) |
| 989 | var nonDefaultDataStoreNames []sgbucket.DataStoreName |
| 990 | for _, keyspace := range keyspaces { |
| 991 | scopeAndCollection := strings.Split(keyspace, ScopeCollectionSeparator) |
| 992 | nonDefaultDataStoreNames = append(nonDefaultDataStoreNames, |
| 993 | ScopeAndCollectionName{ |
| 994 | Scope: scopeAndCollection[0], |
| 995 | Collection: scopeAndCollection[1]}) |
| 996 | } |
| 997 | return nonDefaultDataStoreNames |
| 998 | } |
| 999 | |
| 1000 | // TestClusterSpec returns the cluster spec for the test bucket pool. |
| 1001 | func TestClusterSpec(t *testing.T) CouchbaseClusterSpec { |
no test coverage detected