Skip to content
Snippets Groups Projects

Fix Environment terminal specs for EE

Merged Yorick Peterse requested to merge environment-specs-for-ee into master
All threads resolved!

What does this MR do?

In EE we redefine Environment#terminals, which makes it impossible to use allow_any_instance_of(Environment) or expect_any_instance_of(Environment). Other approaches of stubbing this class, such as by stubbing new, only result in spec failures.

To solve this issue, we add a simple defined?(EE) check in the tests to change the thing that we are testing. This is rather obnoxious, because it requires EE knowledge in CE, and can break if EE::Environment is removed without updating CE. Unfortunately, it appears to be the only solution we have apart from modifying these tests in EE (which would cause merge conflicts).

What are the relevant issue numbers?

This is necessary to get the builds in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/8424 to pass.

Does this MR meet the acceptance criteria?

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Yorick Peterse added 80 commits

    added 80 commits

    Compare with previous version

  • assigned to @rymai

  • Not sure what is going on with the review apps, but I think it is unrelated.

  • @yorickpeterse Thank you, looks good to me! :heart: :yellow_heart: :green_heart: :rocket:

    Not sure what is going on with the review apps, but I think it is unrelated.

    Yeah, I've retried the smoke QA job but no luck...

  • Rémy Coutable resolved all discussions

    resolved all discussions

  • Rémy Coutable approved this merge request

    approved this merge request

  • Rémy Coutable mentioned in commit d91c5bee

    mentioned in commit d91c5bee

  • Please register or sign in to reply
    Loading