xebia-functional / nine-cards-v2

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

Improve the use of Market API #1212

Closed diesalbla closed 7 years ago

diesalbla commented 7 years ago

There are several aspects of the use of the Android Market API from the backend server application that have caused errors during beta-testing that should be replaced

This issue is related to issue #1097, for which a solution is delivered in this PR.

diesalbla commented 7 years ago

@javipacheco Since the goal of the ticket is to improve the method for fetching app details, the goal QA should check 1) that the information is correctly fetched, and 2) that the latency times are effectively reduced.

Setup

Use the setup.sql file in the /assets/postman directory. For the QA, you will need an AndroidId and a Google Play Token, which are known to be accepted by the Android market API. For the androidId to be authorised by the backend app, you need to associate it to the ann user in the setup, which you can do inside a `psql console with the following command:

 insert into installations(`userId`, `deviceToken`, `androidId` ) values 
  ((select id from users where sessiontoken='anntok'), '', '<ANDROID_ID>' ); 

Before the QA, you will also need to clean the local Redis Server.

QA Testing

SInce the goal is to compare same functionality before and after the changes, we will use a same call to the /applications/details endpoint. The call is already stored in the Postman collection (updated in this branch), and the details are in the accompanying environment. You will only need to put your Android Id and the Google Play Token in the Headers.

To make the call more interesting than the default one, we use a longer list of packages, which we give in this attached file: resolvable.txt. This file contains 100 packages, all of which are known to be resolvable, i.e., to refer existing Android applications.

To see the improvements, you should compare the results obtained by running the requests in the master branch and in the PR branch. To measure the number of resolved packages, you can use the following command:

echo "keys *:Resolved" | redis-cli | wc -l

Since the Google Play token may have some quota exhausted, you may want to allow for some time between them. Also, remember to clear the cache before each experiment.

javipacheco commented 7 years ago

Great job!

I have tried 100 new packages using this branch and the time was 19 seconds

In master the same 100 packages, the time was 29 seconds

LGTM!

gif

diesalbla commented 7 years ago

This ticket's work was incorporated during this past week to the master branch.