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

Revamp specs to stop relying on seeded data #4199

Closed
dorner opened this issue Mar 17, 2024 · 4 comments · Fixed by #4206
Closed

Revamp specs to stop relying on seeded data #4199

dorner opened this issue Mar 17, 2024 · 4 comments · Fixed by #4206

Comments

@dorner
Copy link
Collaborator

dorner commented Mar 17, 2024

Summary

Currently, our specs create the following data before every single test:

  • Create 45 base items.
  • Create an organization with 45 items.
  • Create 4 org users.
  • Create a partner, a partner profile and a partner user.

These are set to instance variables.

This causes all of our specs to be significantly slower since a huge number of specs do not need all this data. It also makes them confusing since it relies on data that was factory-created rather than specifying the data it knows and cares about.

We should do the following:

  • Add a metadata tag which, when set, does not create any seeded information.
  • Go through each spec (starting with non-system specs), set the metadata tag to true, create any necessary data, and ensure that any organizations created are given the skip_items trait. We may want to add some additional traits (e.g. with_items for organizations) for the rare cases where we actually do need those 45 items.
  • PRs can be created with groups of specs so we don't have to wait for a big bang release.
  • Once every single spec is using this pattern, we can remove the metadata tag from all specs, the skip_items trait, and the seed_items call.

Things to consider

No response

Criteria for Completion

No response

@elasticspoon
Copy link
Collaborator

I'll take this. I've been wanting to look over the specs and evaluate which specs can be changed system => request, request => model/service, etc.

@dorner
Copy link
Collaborator Author

dorner commented Mar 18, 2024

You got it! Note that this issue doesn't really touch the system -> request movement - although I'm happy to take any PRs on that account as well. You're free to pick whichever one strikes your fancy. IMO this one is more generally useful though, since it affects literally every single test.

Copy link
Contributor

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

Copy link
Contributor

Automatically unassigned after 7 days of inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants