示例#1
0
// getTestStoreConfig returns a configuration, amenable to testing, based on compiled-in engines.
func getTestStoreConfig() (*storage.Backend, error) {
	testableEng := storage.GetTestableEngine()
	if testableEng == nil {
		return nil, fmt.Errorf("Could not find a storage engine that was testable")
	}
	return testableEng.GetTestConfig()
}
示例#2
0
// GetTestStoreConfig returns a configuration, amenable to testing, based on compiled-in engines.
func GetTestStoreConfig() (*dvid.StoreConfig, error) {
	testableEng := storage.GetTestableEngine()
	if testableEng == nil {
		return nil, fmt.Errorf("Could not find a storage engine that was testable")
	}
	dbname := fmt.Sprintf("dvid-test-%x", uuid.NewV4().Bytes())
	engConfig := dvid.EngineConfig{Engine: testableEng.GetName(), Path: dbname, Testing: true}
	return &dvid.StoreConfig{Mutable: engConfig}, nil
}
示例#3
0
func CloseTest() {
	dvid.Infof("Closing and deleting test datastore...\n")
	testableEng := storage.GetTestableEngine()
	if testableEng == nil {
		log.Fatalf("Could not find a storage engine that was testable")
	}
	config, _ := testStore.backend.StoreConfig("default")
	testableEng.Delete(config)
	testStore.Unlock()
}
示例#4
0
func CloseTest() {
	dvid.Infof("Closing and deleting test datastore...\n")
	testableEng := storage.GetTestableEngine()
	if testableEng == nil {
		log.Fatalf("Could not find a storage engine that was testable")
	}
	testableEng.Delete(testStore.config.Mutable)

	testStore.Unlock()
}