make the typecheck tests v2 compatible
commitfcbefbedc4de71688d9898683d2c2c4abcbedfe6
authorShayne Fletcher <shaynefletcher@fb.com>
Mon, 29 Nov 2021 21:16:14 +0000 (29 13:16 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Mon, 29 Nov 2021 21:17:43 +0000 (29 13:17 -0800)
tree72af5f54382444acb50f96fe8c11ba7b002f3ba4
parentb61fa7197abb8fa727af2a7b935b86502988c521
make the typecheck tests v2 compatible

Summary:
There are a bunch of hack typechecker tests based around some Python and shell scripts that very much want to be run from fbsource/fbcode (run the tests, if the output differs, offer to automate updating the expect files sort of thing). buck1 arranges for them to be run from fbcode but the current behavior of buck2 is to run from fbsource. I explored one way of achieving buck1/buck2 compatibility in D32629408 but this turns out to be way hard and not a lot to be gained today for much work. A much easier "hack" that sees us on our way today is given here.

Note that even this isn't the whole story. These tests are also executed under dune (presumably for OSS) from some ancestor of fbcode and there is special case logic in 'verify.py'  and 'review.sh' to account for that. So, care is taken here to only adjust the working directory in the case of buck2.

Some related chat:
- https://fb.workplace.com/groups/buck2users/permalink/3023616267894734/
 - https://fb.workplace.com/groups/buck2prototyping/posts/2800385523592263/?comment_id=2800401463590669

Reviewed By: ndmitchell

Differential Revision: D32698005

fbshipit-source-id: 11fab5789240ec3bebcd8f310d663aa2e606e990
hphp/hack/test/verify.py