Important
This is a specific version of the original Mastodon codebase for the workshop on tests profiling with TestProf.
Mastodon is a free, open-source social network server based on ActivityPub where users can follow friends and discover new ones...
See the full project's description here.
First, install the following tools:
Now, run Dip to provision Docker development enviroment enough to run unit tests (we don't need browser tests for this workshop):
dip provisionThis command may take some time and should complete with success (you will see the message telling you about it). It may ask you some questions—answer with "yes" and continue.
Now, verify your setup by running all tests:
dip rspecMake sure all is green. If not, don't hesitate to reach out.
Now, when everything is ready, you can open a terminal within a Docker container to start playing with TestProf:
dip runnerWe're going to analyze some flamegraphs and profiler reports during the workshop, so it's worth having them installed:
-
gem install profile-viewer -
npm install -g speedscope
If you want to measure the effect of every optimization change made (and see the progress), you can use hyperfine as follows:
hyperfine -L commit "readme","debug require false","opt-in coverage","logging" --runs 2 --show-output --cleanup 'git checkout railsconf2024' --export-markdown 'tmp/results.md' "git -c advice.detachedHead=false checkout ':/{commit}' && dip rspec:notty"The command above runs tests 2 times for specified commits (matching commit messages) and produces a markdown table. Feel free to adjust it to your needs!