xebia-functional / nine-cards-v2

An Open Source Android Launcher built with Scala on Android
http://www.9cards.io/
Other
184 stars 20 forks source link

Redis Cache: change keys and values #698

Closed diesalbla closed 8 years ago

diesalbla commented 8 years ago

The purpose of this ticket is to define the datatypes for the new format of keys and values that are to be stored in the Redis Cache.

Each key will be a record that will contain the following fields:

The types of the values stored will depend upon the type of the key.

For resolved or permanent entries, the value will be a FullCard.

For other responses, the value would have no information.

diesalbla commented 8 years ago

Here is the PR.

diesalbla commented 8 years ago

The instructions for the QA are as follows.

1) In a terminal session open the Redis Client redis-cli, and clear the cache executing the command flushAll. 2) In another terminal, run the google-play backend application, using the application.conf configuration file.

sbt -Dconfig.file="src/main/resources/application.conf" run

3) With a valid androidId and token, execute the following command (a call to the endpoint to get many cards):

curl -X POST \ 
  -H "X-Google-Play-Token: <TOKEN>"\
  -H "X-Android-ID: <ANDROIDID>"\
  -H "Content-Type: application/json"\
  --data @body.txt \
  "http://localhost:8081/googleplay/cards"

where body.txt is the file attached to this message.

4) In the terminal with the redis-client, look up the contents of the cache.

echo 'keys "*Resolved*" '  | redis-cli | sed 's:\":\\\":g;s:\(.*\):get "\1":' | redis-cli  | jq .
echo 'keys "*Pending*" '  | redis-cli   | sed 's:\":\\\":g;s:\(.*\):get "\1":' | redis-cli  | jq .

Note: the androidId and token do not need to be authenticated, since the operations on the cache are also done with the results from the Web Scrapper.

diesalbla commented 8 years ago

Here is the merge PR.