Its important to consider different values of remote configs for running performance tests. Not considering remote config change while running performance test can lead to miss catching regressions, especially which are due to different values of remote configs.
Hence for running performance benchmarks its important to also mock remote config values. This would help increase coverage of your performance tests to catch regressions which can happen due to different values of remote configs. This repository shows how can we mock firebase remote config values for your performance tsts.
- Remote config resolves the values from network, packaged defaults or statically and stores in frc activated json in app file cache.
- We can mock this file to test the code with different values.
- With help of Firebase Remote Config Api we can get all conditions on remote
- For all conditions we can generate activated json with parameter values resolving for that condition
- These activated json files can then be pushed to app file cache before running any performance test
- This will ensure that you are testing for all possible conditional values on remote
DISCLAIMER: This assumes that you are not running performance test with real network which should not be the case because it can be source of noise for your performance benchmarks.
- You need to generate service account json file and save it in your local from firebase console to get access token
- Create secrets.json and save project id in it.
{
"project_id": "<your-firebase-project-id-here>"
}
- Run
./gradlew fatJar
- Generate mocked configs for each condition by executing following command
java -jar ./build/libs/MockRemoteConfig.jar --appId <package-id> --secret <path-to-secrets-file> --serviceAccount <path-to-service-account>