tile38/tests
tidwall ae3e549cfc Add missing test 2022-12-29 11:58:10 -07:00
..
107
616
README.md
aof_legacy Better AOFMIGRATE tests 2022-09-27 10:06:47 -07:00
aof_test.go
client_test.go Allow enough time for client to connect 2022-11-22 07:50:45 -07:00
fence_roaming_test.go
fence_test.go Replace out old style atomics 2022-11-03 10:07:17 -07:00
follower_test.go Better FOLLOW/MONITOR tests 2022-09-27 14:06:24 -07:00
json_test.go
keys_search_test.go Parallel integration tests 2022-09-26 13:26:46 -07:00
keys_test.go Add missing test 2022-12-29 11:58:10 -07:00
metrics_test.go
mock_io_test.go
mock_test.go
monitor_test.go Better FOLLOW/MONITOR tests 2022-09-27 14:06:24 -07:00
scripts_test.go
stats_test.go Parallel integration tests 2022-09-26 13:26:46 -07:00
testcmd_test.go
tests_test.go Clean up test output 2022-09-27 14:42:52 -07:00
timeout_test.go

README.md

Tile38 Integation Testing

  • Uses Redis protocol
  • The Tile38 data is flushed before every DoBatch

A basic test operation looks something like:

func keys_SET_test(mc *mockServer) error {
	return mc.DoBatch([][]interface{}{
        {"SET", "fleet", "truck1", "POINT", 33.0001, -112.0001}, {"OK"},
        {"GET", "fleet", "truck1", "POINT"}, {"[33.0001 -112.0001]"},
    }
}

Using a custom function:

func keys_MATCH_test(mc *mockServer) error {
	return mc.DoBatch([][]interface{}{
        {"SET", "fleet", "truck1", "POINT", 33.0001, -112.0001}, {
            func(v interface{}) (resp, expect interface{}) {
                // v is the value as strings or slices of strings
                // test will pass as long as `resp` and `expect` are the same.
                return v, "OK"
            },
		},
    }
}