|
34 | 34 | fail-fast: false |
35 | 35 | matrix: |
36 | 36 | include: |
37 | | - - script: | |
38 | | - cd e2e/result-cache-atomic-save |
39 | | - ../../bin/phpstan |
40 | | - INODE=$(ls -i tmp/resultCache.php | awk '{print $1}') |
41 | | - ../../bin/phpstan |
42 | | - # The cache is written next to its final path and renamed into place, so saving it |
43 | | - # again replaces the file rather than truncating and rewriting the one the next run |
44 | | - # reads. That is what keeps a run killed mid-save from leaving a partial cache behind. |
45 | | - REPLACED=$([ "$INODE" != "$(ls -i tmp/resultCache.php | awk '{print $1}')" ] && echo replaced || echo 'written in place') |
46 | | - ../bashunit -a equals 'replaced' "$REPLACED" |
47 | | - # A completed save leaves nothing next to the cache file. |
48 | | - LEFTOVERS=$(ls tmp/ | grep -c '\.tmp$' || true) |
49 | | - ../bashunit -a equals '0' "$LEFTOVERS" |
50 | | - OUTPUT=$(../../bin/phpstan -vvv 2>&1) |
51 | | - echo "$OUTPUT" |
52 | | - ../bashunit -a contains 'Result cache restored. 0 files will be reanalysed.' "$OUTPUT" |
53 | 37 | - script: | |
54 | 38 | cd e2e/result-cache-1 |
55 | 39 | echo -n > phpstan-baseline.neon |
@@ -140,6 +124,22 @@ jobs: |
140 | 124 | mv src/Foo.php.orig src/Foo.php |
141 | 125 | echo -n > phpstan-baseline.neon |
142 | 126 | ../../bin/phpstan -vvv |
| 127 | + - script: | |
| 128 | + cd e2e/result-cache-atomic-save |
| 129 | + ../../bin/phpstan |
| 130 | + INODE=$(ls -i tmp/resultCache.php | awk '{print $1}') |
| 131 | + ../../bin/phpstan |
| 132 | + # The cache is written next to its final path and renamed into place, so saving it |
| 133 | + # again replaces the file rather than truncating and rewriting the one the next run |
| 134 | + # reads. That is what keeps a run killed mid-save from leaving a partial cache behind. |
| 135 | + REPLACED=$([ "$INODE" != "$(ls -i tmp/resultCache.php | awk '{print $1}')" ] && echo replaced || echo 'written in place') |
| 136 | + ../bashunit -a equals 'replaced' "$REPLACED" |
| 137 | + # A completed save leaves nothing next to the cache file. |
| 138 | + LEFTOVERS=$(ls tmp/ | grep -c '\.tmp$' || true) |
| 139 | + ../bashunit -a equals '0' "$LEFTOVERS" |
| 140 | + OUTPUT=$(../../bin/phpstan -vvv 2>&1) |
| 141 | + echo "$OUTPUT" |
| 142 | + ../bashunit -a contains 'Result cache restored. 0 files will be reanalysed.' "$OUTPUT" |
143 | 143 | - script: | |
144 | 144 | cd e2e/bug-14514 |
145 | 145 | composer install |
|
0 commit comments