[openstreetmap/openstreetmap-website] Skip intermediate lengths when testing tag validity (#3222)

Andy Allan notifications at github.com
Wed Jun 16 08:58:45 UTC 2021


It's really the upper and lower boundaries that we want to check, and it's reasonable to assume all the intermediate values will work fine if the boundary values are tested.

This also saves about 75% of the time taken and almost 85% of the assertions when running all the model tests.

Rough notes from my laptop when running `bundle exec rails test test/models/`:

Before:

```
Finished in 21.187886s, 11.1384 runs/s, 314.2362 assertions/s.
236 runs, 6658 assertions, 0 failures, 0 errors, 0 skips
```

After:

```
Finished in 6.723931s, 35.0985 runs/s, 160.3229 assertions/s.
236 runs, 1078 assertions, 0 failures, 0 errors, 0 skips
```
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Skip intermediate lengths when testing tag validity

-- File Changes --

    M test/models/changeset_tag_test.rb (4)
    M test/models/message_test.rb (2)
    M test/models/node_tag_test.rb (4)
    M test/models/old_node_tag_test.rb (4)
    M test/models/old_relation_tag_test.rb (4)
    M test/models/old_way_tag_test.rb (4)
    M test/models/relation_tag_test.rb (4)
    M test/models/user_preference_test.rb (2)
    M test/models/way_tag_test.rb (4)

-- Patch Links --

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

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3222
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20210616/8961b4b0/attachment.htm>


More information about the rails-dev mailing list