README ¶
Unit Test Workflows
Setting up the test enviroment (for etcd metadata storage)
- Need to install etcd , add
root
user and enable authentication. You can use this link to setup etcd. - Update the root password in your .env file.
- You are good to go.
For boltdb, badger metadata storage
You just need to specify ZINC_METADATA_STORAGE environment variable to "bolt" or "badger" . Default value of ZINC_METADATA_STORAGE is "bolt"
Steps to run tests
- A bash script at project root named
test.sh
can be used to run these unit tests.
cd zinc
./test.sh
- If you pass an argument
bench
then it will run the benchmark test.
./test.sh bench
API Tests
Testing Authentication (Test File : auth_test.go)
-
Testing Auth API
-
Testing User API
Test Base API (Test File : base_test.go)
Base API Test
Test Document Bulk (Test File : document_bulk_test.go)
-
Test Bulk Document with Endpoint /api/_bulk
-
Test Bulk Document with Enpoint /api/:target/_bulk
Test Document (Test File: document_test.go)
-
Test Create Document with Endpoint /api/:target/_doc
-
Test Update Document with Endpoint /api/:target/_doc/:id
-
Test Delete Document with Endpoint /api/:target/_doc/:id
Test Index (Test File : index_test.go)
-
Test Index with Endpoint /api/index
-
Test Index Mapping with Endpoint /api/:target/_mapping
Test ElasticSeacrch API (Test File : es_test.go)
-
Test ES API with Endpoint /es/_bulk
-
Test ES API with Endpoint /es/:target/_bulk
-
Test ES API with Endpoint /es/:target/_doc
-
Test ES API with Endpoint /es/:target/_doc/:id
-
Test ES API with Endpoint /es/:target/_doc/:id
-
Test ES API with Endpoint /es/:target/_create/:id (PUT)
-
Test ES API with Endpoint /es/:target/_create/:id (POST)
-
Test ES API with Endpoint /es/:target/_update/:id
Test Document Searchv1 (Test File : search_v1_test.go)
-
Test Search with Endpoint /api/:target/_search
- Test Search Document with no existing Index
- Test Search Document with existing Index
- Test Search Document with no existing Term
- Test Search Document with existing Term
- Test Search Document with search type all documents
- Test Search Document with search type wildcard
- Test Search Document with search type fuzzy
- Test Search Document with search type term
- Test Search Document with search type data range
- Test Search Document with search type match all
- Test Search Document with search type match
- Test Search Document with search type match phrase
- Test Search Document with search type multiphrase
- Test Search Document with search type prefix
- Test Search Document with search type query string
-
Test Search Document with Aggregation
Test Document Searchv2 (Test File : search_v2_test.go)
-
Test Search Document with Endpoint /es/:target/_search
- Test Search Document with no existing Index
- Test Search Document with existing Index
- Test Search Document with no existing Term
- Test Search Document with existing Term
- Test Search Document with search type match all
- Test Search Document with search type wildcard
- Test Search Document with search type fuzzy
- Test Search Document with search type term
- Test Search Document with search type data range
- Test Search Document with search type match
- Test Search Document with search type match phrase
- Test Search Document with search type prefix
- Test Search Document with search type query string
-
Test Search Document with Aggregation
Test Analyzers (Test File : analyze_test.go)
Benchmark Test
Test Benchmark (Test File : bulk_test.go)
Click to show internal directories.
Click to hide internal directories.