-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the read concern header (#408)
* feat: add the read concern header Add the read concern option to the cache Configuration and thread it through to the gRPC internals of the client. Add an argument to the UserHeaderInterceptor constructor representing a list of extra headers to add to every request. The stubs manager uses this to add the read concern header if it isn't set to balanced. Make the base cache test class create a client with either balanced or consistent read concern based on whether the CONSISTENT_READS env var is defined. Add tasks to run integration tests for the different clients. Add make targets to use the new tasks. Organize integration tests into auth/cache/storage/topics packages.
- Loading branch information
Showing
24 changed files
with
227 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,66 @@ | ||
.PHONY: all | ||
.PHONY: all clean build test prod-test test-unit test-integration test-auth-service test-cache-service \ | ||
test-leaderboard-service test-storage-service test-topics-service test-http-service format lint precommit help | ||
|
||
all: precommit | ||
|
||
.PHONY: clean | ||
## Clean the project | ||
clean: | ||
./gradlew clean | ||
|
||
.PHONY: build | ||
## Build the project | ||
build: | ||
./gradlew build | ||
|
||
.PHONY: test | ||
## Run all the tests | ||
test: test-unit test-integration | ||
|
||
.PHONY: test-unit | ||
## Run the unit tests | ||
test-unit: | ||
./gradlew test | ||
|
||
.PHONY: test-integration | ||
## Run the integration tests | ||
## Run all integration tests | ||
test-integration: | ||
./gradlew intTest | ||
./gradlew integrationTest | ||
|
||
## Run all integration tests with consistent reads enabled | ||
prod-test: | ||
@CONSISTENT_READS=1 $(MAKE) test-integration | ||
|
||
## Run the auth service tests | ||
test-auth-service: | ||
@CONSISTENT_READS=1 ./gradlew test-auth-service | ||
|
||
## Run the cache service tests | ||
test-cache-service: | ||
@CONSISTENT_READS=1 ./gradlew test-cache-service | ||
|
||
## Run the leaderboard service tests | ||
test-leaderboard-service: | ||
@echo "Leaderboard client not implemented yet." | ||
|
||
## Run the storage service tests | ||
test-storage-service: | ||
@CONSISTENT_READS=1 ./gradlew test-storage-service | ||
|
||
## Run the topics service tests | ||
test-topics-service: | ||
@CONSISTENT_READS=1 ./gradlew test-topics-service | ||
|
||
## Run the http service tests | ||
test-http-service: | ||
@echo "No tests for http service." | ||
|
||
.PHONY: format | ||
## Format the code | ||
format: | ||
./gradlew spotlessApply | ||
|
||
.PHONY: lint | ||
## Lint the code | ||
lint: | ||
./gradlew spotlessCheck | ||
|
||
.PHONY: precommit | ||
## Run the precommit checks | ||
precommit: format lint build test | ||
|
||
.PHONY: help | ||
# See <https://gist.github.com/klmr/575726c7e05d8780505a> for explanation. | ||
help: | ||
@echo "$$(tput bold)Available rules:$$(tput sgr0)";echo;sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## //;td" -e"s/:.*//;G;s/\\n## /---/;s/\\n/ /g;p;}" ${MAKEFILE_LIST}|LC_ALL='C' sort -f|awk -F --- -v n=$$(tput cols) -v i=19 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf"%s%*s%s ",a,-i,$$1,z;m=split($$2,w," ");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;printf"\n%*s ",-i," ";}printf"%s ",w[j];}printf"\n";}'|more $(shell test $(shell uname) == Darwin && echo '-Xr') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...ava/momento/sdk/AuthClientTopicTests.java → ...omento/sdk/auth/AuthClientTopicTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nto/sdk/CacheDataPlaneClientSideTest.java → ...k/cache/CacheDataPlaneClientSideTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package momento.sdk; | ||
package momento.sdk.cache; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
|
3 changes: 2 additions & 1 deletion
3
...dk/CacheDataPlaneEagerConnectionTest.java → ...he/CacheDataPlaneEagerConnectionTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
.../java/momento/sdk/CacheDataPlaneTest.java → ...momento/sdk/cache/CacheDataPlaneTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...Test/java/momento/sdk/DictionaryTest.java → ...ava/momento/sdk/cache/DictionaryTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...rc/intTest/java/momento/sdk/ListTest.java → ...Test/java/momento/sdk/cache/ListTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...src/intTest/java/momento/sdk/SetTest.java → ...tTest/java/momento/sdk/cache/SetTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...tTest/java/momento/sdk/SortedSetTest.java → ...java/momento/sdk/cache/SortedSetTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.