Skip to content

Commit 36733d5

Browse files
Added test showcasing one of the bugs: (#12726)
eager watch mode doesn't register promotions at all for diff rules (but not cram tests) Signed-off-by: Ambre Austen Suhamy <[email protected]> Co-authored-by: Shon Feder <[email protected]>
1 parent 1549dbd commit 36733d5

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
This test shows that the eager watch server doesn't register promotions at all
2+
3+
$ . ./helpers.sh
4+
5+
$ echo '(lang dune 3.20)' > dune-project
6+
7+
$ cat > dune << EOF
8+
> (rule
9+
> (alias a)
10+
> (action
11+
> (progn
12+
> (write-file a.output "processed A")
13+
> (diff a a.output))))
14+
> EOF
15+
16+
$ echo "raw A" > a
17+
18+
$ dune build -w &
19+
File "a", line 1, characters 0-0:
20+
Error: Files _build/default/a and _build/default/a.output differ.
21+
Had 1 error, waiting for filesystem changes...
22+
File "a", line 1, characters 0-0:
23+
Error: Files _build/default/a and _build/default/a.output differ.
24+
Had 1 error, waiting for filesystem changes...
25+
Warning: Nothing to promote for a.
26+
$ dune rpc ping --wait
27+
Server appears to be responding normally
28+
Added safety measure against racy behaviour.
29+
$ sleep 1
30+
31+
Now A should be in the promotion database
32+
$ dune build @a
33+
File "a", line 1, characters 0-0:
34+
Error: Files _build/default/a and _build/default/a.output differ.
35+
Error: Build failed with 1 error.
36+
[1]
37+
38+
This should be raw, as we haven't promoted yet
39+
$ cat a
40+
raw A
41+
42+
The promotion database should exist!
43+
$ find _build/.to-promote
44+
find: '_build/.to-promote': No such file or directory
45+
[1]
46+
47+
This should be a success
48+
$ dune promote a
49+
Success
50+
51+
This should be processed
52+
$ cat a
53+
raw A
54+
55+
$ dune shutdown
56+
$ wait

0 commit comments

Comments
 (0)