Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster tests 1 - ability_spec.rb #1244

Merged
merged 4 commits into from
Sep 16, 2024
Merged

Faster tests 1 - ability_spec.rb #1244

merged 4 commits into from
Sep 16, 2024

Conversation

jrhoads
Copy link
Contributor

@jrhoads jrhoads commented Sep 16, 2024

Purpose

Reduces the total clock time for ability_spec.rb from 21 minutes on a local dev environment, down to 10 seconds in a local dev environment. Hopefully this will reduce the amount of time spent on the parallel test suite as well as the overall test runtime.

closes: #1243

Approach

There are three parts to this:

  1. Skip elasticsearch setup-teardown where not used
  2. Skip prefix allocation setup-teardown where not used
  3. Use fixtures with build instead of create where possible to skip db connections and post-creation hooks.

Learning

This is a great blogpost that lead me to several of the insights in this PR.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

  • New feature (non-breaking change which adds functionality)

  • Breaking change (fix or feature that would cause existing functionality to change)

Reviewer, please remember our guidelines:

  • Be humble in the language and feedback you give, ask don't tell.
  • Consider using positive language as opposed to neutral when offering feedback. This is to avoid the negative bias that can occur with neutral language appearing negative.
  • Offer suggestions on how to improve code e.g. simplification or expanding clarity.
  • Ensure you give reasons for the changes you are proposing.

@jrhoads jrhoads merged commit 25a8b6b into master Sep 16, 2024
13 checks passed
@jrhoads jrhoads deleted the faster-tests-1 branch September 16, 2024 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reduce runtime of ability_spec.rb
3 participants