1. Install the previous stable version of Moodle (latest stable release on the previous branch).
2. Set it up with some courses. Pulling them from Mooch is a quick way to do this.
3. Add some users, enrol them in courses, and make some user content.
4. Set the debugging level to DEVELOPER. Make sure you can see errors (display them on screen or monitor the error log)
5. Upgrade the code to this current version of Moodle you are testing.
6. Visit /admin and go through the upgrade process.
7. It should complete without any errors.
8. Repeat above steps after defining `$CFG->upgradekey` in the config.php. Make sure that when you attempt to upgrade the site via the web UI, the user must provide the valid upgradekey value. The non-admin user should have no access to any information regarding the site and/or plugins versions.