fix typos in server_test.md

pull/2945/head
ben hockey 2015-06-11 15:43:43 -05:00
parent e89d2d85a6
commit aef4ba2e20
1 changed files with 5 additions and 9 deletions

View File

@ -1,6 +1,6 @@
# Server Integration Tests
Currently, the file `server_test.go` has integration tests for single node scendarios.
Currently, the file `server_test.go` has integration tests for single node scenarios.
At some point we'll need to add cluster tests, and may add them in a different file, or
rename `server_test.go` to `server_single_node_test.go` or something like that.
@ -11,15 +11,15 @@ Each test is broken apart effectively into the following areas:
- Write sample data
- Use cases for table driven test, that include a command (typically a query) and an expected result.
When the each test runs it does the following:
When each test runs it does the following:
- init: determines if there are any writes and if so, writes them to the in memory database
- init: determines if there are any writes and if so, writes them to the in-memory database
- queries: iterate through each query, executing the command, and comparing the results to the expected result.
## Idempotent - Allows for parallel tests
Each test should be `idempotent`, meaining that it's data will not be affected by other tests, or use cases within the table tests themselves.
This allows for parellel testing, keeping the test suite total exucution time very low.
Each test should be `idempotent`, meaining that its data will not be affected by other tests, or use cases within the table tests themselves.
This allows for parallel testing, keeping the test suite total execution time very low.
### Basic sample test
@ -88,17 +88,14 @@ if err := s.CreateDatabaseAndRetentionPolicy("db0", newRetentionPolicyInfo("rp0"
}
```
Next, set up the write data you need:
```go
writes := []string{
fmt.Sprintf("cpu,host=server01 value=100,core=4 %d", mustParseTime(time.RFC3339Nano, "2000-01-01T00:00:00Z").UnixNano()),
fmt.Sprintf("cpu1,host=server02 value=50,core=2 %d", mustParseTime(time.RFC3339Nano, "2015-01-01T00:00:00Z").UnixNano()),
}
```
Create a new test with the database and retention policy:
```go
@ -130,7 +127,6 @@ test.addQueries([]*Query{
The rest of the code is boilerplate execution code. It is purposefully not refactored out to a helper
to make sure the test failure reports the proper lines for debugging purposes.
#### Running the tests
To run the tests: