-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Update command keeps detached tests
Summary: This CL delegates the detached exit status to enable the `scrut update` command to update test files that contain detached tests. # What? - The detached error status is forwarded - Update generators receive one output per testcase (whether detached or not) - Update creates all testcases (including detached) # Why? - Enable updating of tests files that have `detached: true` tests Reviewed By: abesto Differential Revision: D59751010 fbshipit-source-id: 8366f3e00f52d5309fe680d5879d06ac444c6f4c
- Loading branch information
1 parent
f18d672
commit 61801f3
Showing
4 changed files
with
65 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# Update tests that use detached | ||
|
||
Tests in this file validate that `update` commands on test files that contain `detached: true` tests leaves them unchanged. | ||
|
||
```scrut | ||
$ alias scrut_update='$SCRUT_BIN update --match-markdown="*.mdtest"' | ||
``` | ||
|
||
## Create backup to compar against later | ||
|
||
```scrut | ||
$ cp "$TESTDIR"/test.mdtest ./test-copy.mdtest | ||
``` | ||
|
||
## Run update | ||
|
||
```scrut | ||
$ scrut_update --replace --assume-yes "$TESTDIR"/test.mdtest | ||
Result: 1 file(s) of which 0 updated, 0 skipped and 1 unchanged | ||
``` | ||
|
||
## File ought to be unchanged | ||
|
||
```scrut | ||
$ diff "$TESTDIR"/test.mdtest ./test-copy.mdtest | ||
``` |
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,27 @@ | ||
# This is an outdated test | ||
|
||
## A detached test | ||
|
||
```scrut {detached: true} | ||
$ echo foo1 | ||
``` | ||
|
||
## A normal test | ||
|
||
```scrut | ||
$ echo foo2 | ||
foo2 | ||
``` | ||
|
||
## Another detached test | ||
|
||
```scrut {detached: true} | ||
$ echo foo3 | ||
``` | ||
|
||
## Another normal test | ||
|
||
```scrut | ||
$ echo foo4 | ||
foo4 | ||
``` |
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