[openstreetmap/openstreetmap-website] Faster tests (PR #4426)

Andy Allan notifications at github.com
Wed Dec 20 12:09:26 UTC 2023


This PR makes our test suite run several minutes quicker (single-thread timings). User creation tests drop on my machine from 200 seconds to 6 seconds.

Previously, several of the user creation tests were repeated 228 times, once in each available locale. This takes a lot of time and provides very little value.

After those were refactored, the next slowest tests were the changeset comment rate limit tests. A simple way to make them run 3-4 times faster is just to reduce the rate limits in the test settings, since this reduces the number of (uninteresting) post requests made.

Rails 7.1 ships with the `--profile` flag, which makes it easy to find the slowest tests, and these stood out when doing so.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4426

-- Commit Summary --

  * Avoid running integration tests in every locale
  * Reduce changeset comment rate limits further in tests

-- File Changes --

    M config/settings/test.yml (4)
    M test/integration/user_creation_test.rb (198)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4426.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4426.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4426
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4426 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231220/2dbb55b6/attachment.htm>


More information about the rails-dev mailing list