January 2020
Intermediate to advanced
640 pages
16h 56m
English
The Elasticsearch-backed indexer implementation defines its own go-check test suite that embeds the shared indexer test suite and provides setup and teardown methods that are specific to the Elasticsearch implementation.
Each the tests in the suite use the same ElasticSearchIndexer instance that is initialized once with the following suite setup method:
func (s *ElasticSearchTestSuite) SetUpSuite(c *gc.C) { nodeList := os.Getenv("ES_NODES") if nodeList == "" { c.Skip("Missing ES_NODES envvar; skipping elasticsearch-backed index test suite") } idx, err := NewElasticSearchIndexer(strings.Split(nodeList, ",")) c.Assert(err, gc.IsNil) s.SetIndexer(idx) // Keep track of the concrete indexer ...