You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Manually testing if the plugin works take time, requires an existent Android project and might miss some cases.
Automated tests ensure that the plugin covers all test cases and is working correctly.
If a CI/CD pipeline is implemented, the automated tests can be run when commits are pushed and inform if a change makes a test to fail, thus ensuring that PRs will not break the plugin.
In order to test the Nappa library, we need to have test data. Creating data at runtime takes too much effort, is prone to error and has no representation of a real/simulated case of a NAPPA enabled app.
A possible solution is to use a test app with Nappa enabled and export the nappa.db database via the Device File Explorer in Android Studio. With this file, we have 2 possibilities:
Import a file .db in our tests
Export a SQL dump from the file .db containing the schema creation and the inserted data. This dump is then executed once before running any test.
I am not sure if option 1 is possible, but I personally prefer option 2, since if we change (and likely will change) the database schema, we can easily apply migrations to ensure that our test data is equivalent to the current Room schema.
This method brings the following benefits:
The test data is deterministic and so should be the test outcome
Minimal effort in creating the data
It is easier to debug the data;
The text was updated successfully, but these errors were encountered:
Manually testing if the plugin works take time, requires an existent Android project and might miss some cases.
Automated tests ensure that the plugin covers all test cases and is working correctly.
If a CI/CD pipeline is implemented, the automated tests can be run when commits are pushed and inform if a change makes a test to fail, thus ensuring that PRs will not break the plugin.
In order to test the Nappa library, we need to have test data. Creating data at runtime takes too much effort, is prone to error and has no representation of a real/simulated case of a NAPPA enabled app.
A possible solution is to use a test app with Nappa enabled and export the
nappa.db
database via theDevice File Explorer
in Android Studio. With this file, we have 2 possibilities:.db
in our tests.db
containing the schema creation and the inserted data. This dump is then executed once before running any test.I am not sure if option 1 is possible, but I personally prefer option 2, since if we change (and likely will change) the database schema, we can easily apply migrations to ensure that our test data is equivalent to the current Room schema.
This method brings the following benefits:
The text was updated successfully, but these errors were encountered: