tests: make .t tests that dont specifically check for Eden work with Eden

Summary:
There are some cases when we want tests to work both with EdenFS and non-EdenFS. Ideally we should not specify anything, so no references to `#require eden` / `#if eden`, etc. should exist.

Before this diff newly added tests only would work on non-EdenFS if it was explicitly required or if there was something that tested against it, similar to what was done in D56220001.

The reason just checking for EdenFS would make EdenFS available in tests' PATHs was that there is some code that eventually updates the list of binaries that should be available in the path:

https://www.internalfb.com/code/fbsource/fbcode/eden/scm/sapling/testing/t/runner.py?lines=349-356

And in turn this is later used to create the wrappers / symlinks that call to the original binaries:

https://www.internalfb.com/code/fbsource/[765627dc802b6cad309e1763479c66ca3cb1fa46]/fbcode/eden/scm/sapling/testing/t/runner.py?lines=396-397

On EdenFS .t tests we are expecting the EdenFS CLI to always be available, which this diff makes so.

Reviewed By: quark-zju

Differential Revision: D56660786

fbshipit-source-id: 33066d4e07b56a7952c61f5b06944a3c6a518231
This commit is contained in:
Saul Gutierrez 2024-04-29 15:29:15 -07:00 committed by Facebook GitHub Bot
parent c132e31054
commit 93cbf4c687
2 changed files with 3 additions and 3 deletions

View File

@ -38,6 +38,8 @@ def testsetup(t: TestTmp):
import re
edenpath = str(t.path / "bin" / "eden")
if "eden" not in t.shenv.cmdtable:
t.requireexe("eden")
t.registerfallbackmatch(
lambda a, b: b == "update complete"
and re.match(

View File

@ -1,8 +1,6 @@
#debugruntest-compatible
#require no-eden
$ configure modern
$ configure modernclient
$ newclientrepo
$ drawdag << 'EOS'
> A01..A20