human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

remove item generation

Open elasticspoon opened this issue 11 months ago • 4 comments

Fixes #4199

Removes seed_items: false from org creation Removes skip_seed: true from all specs Removes all code that used the above behaviors.

Tests no longer rely on preseeded data! 🥳

Base Changes to enable removal of seeding:

  • [x] #4220
  • [x] #4273
  • [x] #4269
  • [x] #4264

Additional PRs:

  • [x] #4236
  • [x] #4221
  • [x] #4222
  • [x] #4223
  • [x] #4325
  • [x] #4329
  • [x] #4330
  • [x] #4332
  • [x] #4334
  • [x] #4336
  • [x] #4337
  • [x] #4339
  • [x] #4348
  • [x] #4349
  • [ ] #4352

elasticspoon avatar Mar 20 '24 04:03 elasticspoon

Yes, this looks great! I'd try to limit the unrelated changes because this is already a really beefy PR.

dorner avatar Mar 22 '24 18:03 dorner

This is just a really early draft. But what do you think is the best way to break it up?

I was thinking:

  • PR with setup -> stuff to enable the flags + modifications to factories if needed
  • 1 PR per X amount of spec files (I was thinking maybe 5-8?)

I was also replacing some some validations and adding association tests with shoulda matchers, which is what I assume you mean by unrelated changes. It made sense to me to "spruce" up the specs and I would open a seperate PR for those changes.

That said. How do you feel about replacing some of those validations with shoulda matchers? I know a lot of people are kind of against them.

elasticspoon avatar Mar 22 '24 19:03 elasticspoon

I was more referring to things like https://github.com/rubyforgood/human-essentials/pull/4206/files#diff-f20ad13724257719bda72f3a7df9e41664e7c5dd4c8ac8f20a08016c72a7ebb4L29 and https://github.com/rubyforgood/human-essentials/pull/4206/files#diff-9f295d05ef1f1d3fa56e894bd8858741bccb3bae309333f4ee47bd2de3aba8c2R120 .

Honestly, I don't find a lot of value at all in the specs that just restate what the model has on it (things like belongs_to or validates_presence_of). Unless it's doing something unusual, like a regex or conditional validation, I don't think we need tests for them at all - that behavior should definitely be tested through one of the higher-level model, request or system tests.

dorner avatar Mar 22 '24 19:03 dorner

I think the way you want to break it makes a lot of sense - let's make it 10 specs as a nice round number and so we don't have dozens of PRs 😄

dorner avatar Mar 22 '24 19:03 dorner

Finally done! Kudos on a very long and tedious project - I am super happy with the changes! 🎉

dorner avatar May 17 '24 20:05 dorner

@elasticspoon: Your PR remove item generation is part of today's Human Essentials production release: 2024.05.26. Thank you very much for your contribution!

github-actions[bot] avatar May 26 '24 14:05 github-actions[bot]