How to deal with the broken CE/EE tests in JH repo

Recently, some tests failed in JH repo (see https://gitlab.com/gitlab-jh/gitlab/-/pipelines/334488406/failures), the reason is previously we overridden a page jh/app/views/layouts/devise.html.haml in JH repo and the test passed at that time (!23 (merged)), but after a few days, the same page was updated in upstream repo and the related tests were also updated to verify the updated page, after these code changes were synced to JH repo, the tests failed because it cannot find the expected text in the JH overridden page, see #119 (closed).

This is actually a general issue: if a page has two versions, one is CE/EE version which is outside of jh/ folder and the other is JH version which is in the jh/ folder, how can we make the same test pass for both of the two versions? I.e.

  1. The test should pass with the page of the CE/EE version in upstream repo.
  2. The test should also pass with the page of the JH version in JH repo.

For 1, I think it is easy and already handled in the upstream repo, so the hard part is 2, when contributors write a test in upstream repo, they will not take care of the page of JH version because there is no jh/ folder in upstream repo at all, but when such test is synced to JH repo, it may fail with the page of the JH version.

Is there a way to write a JH test to override a CE/EE test in JH repo so that the CE/EE test will be skipped and the JH test will just do the verification in the JH way?

Edited by Qian Zhang (Gary)