[go: up one dir, main page]

Skip to content

Refactor `ee/spec/lib/remote_development/agent_config/updater_spec.rb`

The following discussion from !138732 (merged) should be addressed:

  • @cwoolley-gitlab started a discussion:

    suggestion (non-blocking): It's a bit confusing to have these booleans which control how the fixtures are constructed.

    I would like to revisit the design of this entire spec, and try to move towards a more declarative and idiomatic design for the fixtures, where we have minimal (ideally no) logic in the fixture definitions, and instead use different let and let_it_be declarations in different contexts to define the different scenarios.

    Also, since let and let_it_be are cached by default (as opposed to let! and let_it_be(..., reload: true) { ... }), so having conditional logic in their declarations can make the code hard to reason about.

    Here's our docs on best practices for using let: https://docs.gitlab.com/ee/development/testing_guide/best_practices.html#subject-and-let-variables

    But I don't want to block this MR on that, this has adequate coverage of all the cases, so it's fine for now.

    I'll make a follow-up issue to refactor it.