Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix server_test to clear TestCacheIndexHandler #114

Merged
merged 1 commit into from
Jan 16, 2019

Conversation

u5surf
Copy link
Contributor

@u5surf u5surf commented Jan 13, 2019

sorry I added TestCacheIndexHandler to failed following now
on HEAD result:

$ cd server
$ go test -v ./...
=== RUN   TestServiceLoader
--- PASS: TestServiceLoader (0.00s)
=== RUN   TestRequestMetrics
2019/01/13 23:06:21 Entry not found
--- PASS: TestRequestMetrics (0.00s)
    middleware_test.go:46: 2019/01/13 23:06:21 GET request to /api/v1/cache/empty took 180951ns.

=== RUN   TestGetWithNoKey
=== PAUSE TestGetWithNoKey
=== RUN   TestGetWithMissingKey
=== PAUSE TestGetWithMissingKey
=== RUN   TestGetKey
=== PAUSE TestGetKey
=== RUN   TestPutKey
=== PAUSE TestPutKey
=== RUN   TestPutEmptyKey
=== PAUSE TestPutEmptyKey
=== RUN   TestDeleteEmptyKey
=== PAUSE TestDeleteEmptyKey
=== RUN   TestDeleteInvalidKey
=== PAUSE TestDeleteInvalidKey
=== RUN   TestDeleteKey
=== PAUSE TestDeleteKey
=== RUN   TestGetStats
=== PAUSE TestGetStats
=== RUN   TestGetStatsIndex
=== PAUSE TestGetStatsIndex
=== RUN   TestCacheIndexHandler
2019/01/13 23:06:21 stored "putKey" in cache.
2019/01/13 23:06:21 stored "getKey" in cache.
2019/01/13 23:06:21 testDeleteKey not found.
--- FAIL: TestCacheIndexHandler (0.00s)
    server_test.go:236: want: 200; got: 201.
                can't delete keys.
    server_test.go:241: want: 200; got: 201.
                can't delete keys.
    server_test.go:247: want: 200; got: 201.
                can't delete keys.
=== CONT  TestGetWithNoKey
2019/01/13 23:06:21 empty request.
=== CONT  TestDeleteInvalidKey
--- PASS: TestGetWithNoKey (0.00s)
2019/01/13 23:06:21 invalidDeleteKey not found.
=== CONT  TestGetKey
=== CONT  TestGetWithMissingKey
=== CONT  TestDeleteEmptyKey
2019/01/13 23:06:21 Entry not found
--- PASS: TestGetWithMissingKey (0.00s)
=== CONT  TestGetStats
=== CONT  TestPutEmptyKey
2019/01/13 23:06:21  not found.
--- PASS: TestDeleteEmptyKey (0.00s)
=== CONT  TestDeleteKey
--- PASS: TestDeleteInvalidKey (0.00s)
=== CONT  TestGetStatsIndex
--- PASS: TestDeleteKey (0.00s)
=== CONT  TestPutKey
2019/01/13 23:06:21 stored "putKey" in cache.
--- PASS: TestPutKey (0.00s)
2019/01/13 23:06:21 empty request.
--- PASS: TestGetKey (0.00s)
--- PASS: TestPutEmptyKey (0.00s)
--- PASS: TestGetStats (0.00s)
--- PASS: TestGetStatsIndex (0.00s)
FAIL
ok      github.com/allegro/bigcache/server      0.034s

so, I fixed and retest to indicate passing all tests

$ cd server
$ go test -v ./...                                                                                                     
=== RUN   TestServiceLoader
--- PASS: TestServiceLoader (0.00s)
=== RUN   TestRequestMetrics
2019/01/13 23:04:42 Entry not found
--- PASS: TestRequestMetrics (0.00s)
    middleware_test.go:46: 2019/01/13 23:04:42 GET request to /api/v1/cache/empty took 221961ns.

=== RUN   TestGetWithNoKey
=== PAUSE TestGetWithNoKey
=== RUN   TestGetWithMissingKey
=== PAUSE TestGetWithMissingKey
=== RUN   TestGetKey
=== PAUSE TestGetKey
=== RUN   TestPutKey
=== PAUSE TestPutKey
=== RUN   TestPutEmptyKey
=== PAUSE TestPutEmptyKey
=== RUN   TestDeleteEmptyKey
=== PAUSE TestDeleteEmptyKey
=== RUN   TestDeleteInvalidKey
=== PAUSE TestDeleteInvalidKey
=== RUN   TestDeleteKey
=== PAUSE TestDeleteKey
=== RUN   TestGetStats
=== PAUSE TestGetStats
=== RUN   TestGetStatsIndex
=== PAUSE TestGetStatsIndex
=== RUN   TestCacheIndexHandler
2019/01/13 23:04:42 stored "testkey" in cache.
--- PASS: TestCacheIndexHandler (0.00s)
=== CONT  TestGetWithNoKey
2019/01/13 23:04:42 empty request.
--- PASS: TestGetWithNoKey (0.00s)
=== CONT  TestDeleteEmptyKey
2019/01/13 23:04:42  not found.
=== CONT  TestDeleteInvalidKey
--- PASS: TestDeleteEmptyKey (0.00s)
2019/01/13 23:04:42 invalidDeleteKey not found.
=== CONT  TestPutEmptyKey
--- PASS: TestDeleteInvalidKey (0.00s)
=== CONT  TestGetWithMissingKey
2019/01/13 23:04:42 empty request.
2019/01/13 23:04:42 Entry not found
--- PASS: TestGetWithMissingKey (0.00s)
=== CONT  TestGetStatsIndex
--- PASS: TestPutEmptyKey (0.00s)
=== CONT  TestGetKey
--- PASS: TestGetKey (0.00s)
=== CONT  TestGetStats
=== CONT  TestPutKey
2019/01/13 23:04:42 stored "putKey" in cache.
--- PASS: TestPutKey (0.00s)
=== CONT  TestDeleteKey
--- PASS: TestDeleteKey (0.00s)
--- PASS: TestGetStatsIndex (0.00s)
--- PASS: TestGetStats (0.00s)
PASS
ok      github.com/allegro/bigcache/server      0.033s

@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.34% when pulling a6967d1 on u5surf:fix_server_test into f3acb35 on allegro:master.

Copy link
Collaborator

@siennathesane siennathesane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yeah, this is better. I didn't get a chance to see the first PR since I wasn't notified (my fault), but I'm glad this one fixes it. I do like the testing of the core options.

@cristaloleg cristaloleg merged commit 84a0ff3 into allegro:master Jan 16, 2019
u5surf added a commit to u5surf/bigcache that referenced this pull request Jun 4, 2019
flisky pushed a commit to flisky/bigcache that referenced this pull request May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants