-
Notifications
You must be signed in to change notification settings - Fork 485
Stabilize rewatch scheduling and integration tests #8667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
1b11690
Fix deterministic rewatch scheduling
cknitt 3a85c13
Stabilize rewatch integration tests
cknitt b79362b
Preserve blocked dependents across full rewatch rebuilds
cknitt f465543
Abort warning persistence test if watcher stays running
cknitt 9153fbd
Abort watcher tests when shutdown times out
cknitt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
92 changes: 92 additions & 0 deletions
92
rewatch/tests/compile/20-schedule-independent-modules-after-error.sh
This file contains hidden or 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,92 @@ | ||
| #!/bin/bash | ||
|
|
||
| cd $(dirname $0) | ||
| source "../utils.sh" | ||
|
|
||
| bold "Test: Independent modules compile after an unrelated error" | ||
|
|
||
| fixture=$(mktemp -d 2>/dev/null || mktemp -d -t rewatch-schedule-after-error) | ||
| trap "rm -rf '$fixture'" EXIT | ||
|
|
||
| mkdir -p "$fixture/src" | ||
|
|
||
| cat > "$fixture/rescript.json" <<'EOF' | ||
| { | ||
| "name": "rewatch-schedule-after-error", | ||
| "sources": { "dir": "src" }, | ||
| "warnings": { "number": "+26+27+32", "error": false }, | ||
| "package-specs": { "module": "esmodule", "in-source": true }, | ||
| "suffix": ".mjs" | ||
| } | ||
| EOF | ||
|
|
||
| cat > "$fixture/src/Failing.res" <<'EOF' | ||
| let value = 1 | ||
| EOF | ||
|
|
||
| cat > "$fixture/src/Blocked.res" <<'EOF' | ||
| let mirrored = Failing.value | ||
| EOF | ||
|
|
||
| cat > "$fixture/src/IndependentWarning.res" <<'EOF' | ||
| let unusedValue = 42 | ||
|
|
||
| let hello = () => Console.log("hello") | ||
| EOF | ||
|
|
||
| cd "$fixture" | ||
| if ! RAYON_NUM_THREADS=1 RUST_BACKTRACE=1 "$REWATCH_EXECUTABLE" build > /dev/null 2>&1; then | ||
| error "Initial fixture build failed" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Make the dependent's generated output an observable signal: the failing build | ||
| # must leave it absent, and the recovery build must recreate it. | ||
| rm -f src/Blocked.mjs | ||
|
|
||
| cat > src/Failing.res <<'EOF' | ||
| let value: int = "not an int" | ||
| EOF | ||
|
|
||
| cat > src/IndependentWarning.res <<'EOF' | ||
| let unusedValue = 42 | ||
|
|
||
| let hello = () => { | ||
| let secondUnusedValue = 43 | ||
| Console.log("hello") | ||
| } | ||
| EOF | ||
|
|
||
| compiler_output=$(RAYON_NUM_THREADS=1 RUST_BACKTRACE=1 "$REWATCH_EXECUTABLE" build 2>&1) | ||
| build_status=$? | ||
|
|
||
| if [ $build_status -eq 0 ]; then | ||
| error "Build unexpectedly succeeded despite the type error" | ||
| printf "%s\n" "$compiler_output" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if ! printf '%s\n' "$compiler_output" | grep -q "unused variable secondUnusedValue"; then | ||
| error "Independent warning was not emitted after the unrelated failure" | ||
| printf "%s\n" "$compiler_output" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ -f src/Blocked.mjs ]; then | ||
| error "Blocked dependent was compiled despite its failed dependency" | ||
| exit 1 | ||
| fi | ||
|
|
||
| printf 'let value = "recovered"\n' > src/Failing.res | ||
| if ! compiler_output=$(RAYON_NUM_THREADS=1 RUST_BACKTRACE=1 "$REWATCH_EXECUTABLE" build 2>&1); then | ||
| error "Build did not recover after fixing the failed dependency" | ||
| printf "%s\n" "$compiler_output" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| if [ ! -f src/Blocked.mjs ]; then | ||
| error "Previously blocked dependent was not compiled after recovery" | ||
| exit 1 | ||
|
cknitt marked this conversation as resolved.
|
||
| fi | ||
|
|
||
| success "Independent diagnostics and blocked dependents are scheduled correctly" | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.