-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Include the full set of libdefs in saved state
Summary: The only reason we are excluding the builtin ones is because its relative path against the root might be unstable across machines. However, the problem has been addressed with the infra added in D69577613, and we are fully capable of normalizing, storing, and denormalizing all libdef paths, so let's reduce the complexity and just store everything. Changelog: [internal] Reviewed By: panagosg7 Differential Revision: D69871981 fbshipit-source-id: 2024b362b78bc33ab531e02e2652eab9fe8c89b4
- Loading branch information
1 parent
95bcff8
commit 7b624f5
Showing
10 changed files
with
77 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[options] | ||
all=true | ||
lazy_mode=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shell: test.sh | ||
skip_saved_state: true |
Empty file.
21 changes: 21 additions & 0 deletions
21
tests/saved_state_different_root/saved_state_different_root.exp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Generate saved-state | ||
Use saved state in a different root | ||
Error ----------------------------------------------------------------------------------------------------- test.js:1:19 | ||
|
||
Cannot assign `new Object()` to `a` because `Object` [1] is incompatible with string [2]. [incompatible-type] | ||
|
||
test.js:1:19 | ||
1| const a: string = new Object() | ||
^^^^^^^^^^^^ [1] | ||
|
||
References: | ||
test.js:1:10 | ||
1| const a: string = new Object() | ||
^^^^^^ [2] | ||
|
||
|
||
|
||
Found 1 error | ||
|
||
The Flow server is currently in lazy mode and is only checking 2/2 files. | ||
To learn more, visit flow.org/en/docs/lang/lazy-modes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# | ||
# This source code is licensed under the MIT license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
echo "Generate saved-state" | ||
"$FLOW" stop | ||
"$FLOW" start --saved-state-fetcher none | ||
"$FLOW" save-state --out new_root/.flow.saved_state >> /dev/null | ||
"$FLOW" stop | ||
|
||
echo "" > new_root/.flow.saved_state_file_changes | ||
echo "Use saved state in a different root" | ||
mv .flowconfig new_root | ||
cd new_root | ||
"$FLOW" start --saved-state-fetcher local --wait | ||
echo "const a: string = new Object()" > test.js | ||
"$FLOW" force-recheck test.js | ||
assert_errors "$FLOW" status --strip-root |