Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Mastodon

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.

Setting up for test profiling

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 provision

This 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 rspec

Make 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 runner

Misc

Additional profiling tools

We'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

Benchmarking

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!

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages