@@ -10,99 +10,97 @@ object SelectiveExecutionWatchTests extends UtestIntegrationTestSuite {
1010 implicit val retryInterval : RetryInterval = RetryInterval (1 .seconds)
1111 val tests : Tests = Tests {
1212
13- test(" watch" ) {
14- test(" changed-inputs" ) - retry(1 ) {
15- integrationTest { tester =>
16- import tester ._
17- val spawned = spawn((" --watch" , " {foo.fooCommand,bar.barCommand}" ))
13+ test(" changed-inputs" ) - retry(1 ) {
14+ integrationTest { tester =>
15+ import tester ._
16+ val spawned = spawn((" --watch" , " {foo.fooCommand,bar.barCommand}" ))
1817
19- assertEventually {
20- spawned.out.text().contains(" Computing fooCommand" ) &&
21- spawned.out.text().contains(" Computing barCommand" )
22- }
18+ assertEventually {
19+ spawned.out.text().contains(" Computing fooCommand" ) &&
20+ spawned.out.text().contains(" Computing barCommand" )
21+ }
2322
24- // Make sure editing each individual input results in the corresponding downstream
25- // command being re-run, and watches on both are maintained even if in a prior run
26- // one set of tasks was ignored.
27- spawned.clear()
28- modifyFile(workspacePath / " bar/bar.txt" , _ + " !" )
29- assertEventually {
30- ! spawned.out.text().contains(" Computing fooCommand" ) &&
31- spawned.out.text().contains(" Computing barCommand" )
32- }
23+ // Make sure editing each individual input results in the corresponding downstream
24+ // command being re-run, and watches on both are maintained even if in a prior run
25+ // one set of tasks was ignored.
26+ spawned.clear()
27+ modifyFile(workspacePath / " bar/bar.txt" , _ + " !" )
28+ assertEventually {
29+ ! spawned.out.text().contains(" Computing fooCommand" ) &&
30+ spawned.out.text().contains(" Computing barCommand" )
31+ }
3332
34- // Test for a bug where modifying the sources 2nd time would run tasks from both modules.
35- spawned.clear()
36- modifyFile(workspacePath / " bar/bar.txt" , _ + " !" )
37- assertEventually {
38- ! spawned.out.text().contains(" Computing fooCommand" ) &&
39- spawned.out.text().contains(" Computing barCommand" )
40- }
33+ // Test for a bug where modifying the sources 2nd time would run tasks from both modules.
34+ spawned.clear()
35+ modifyFile(workspacePath / " bar/bar.txt" , _ + " !" )
36+ assertEventually {
37+ ! spawned.out.text().contains(" Computing fooCommand" ) &&
38+ spawned.out.text().contains(" Computing barCommand" )
39+ }
4140
42- spawned.clear()
43- modifyFile(workspacePath / " foo/foo.txt" , _ + " !" )
44- assertEventually {
45- spawned.out.text().contains(" Computing fooCommand" ) &&
46- ! spawned.out.text().contains(" Computing barCommand" )
47- }
41+ spawned.clear()
42+ modifyFile(workspacePath / " foo/foo.txt" , _ + " !" )
43+ assertEventually {
44+ spawned.out.text().contains(" Computing fooCommand" ) &&
45+ ! spawned.out.text().contains(" Computing barCommand" )
4846 }
4947 }
50- test(" show-changed-inputs" ) - retry(1 ) {
51- integrationTest { tester =>
52- import tester ._
53- val spawned = spawn((" --watch" , " show" , " {foo.fooCommand,bar.barCommand}" ))
48+ }
49+ test(" show-changed-inputs" ) - retry(1 ) {
50+ integrationTest { tester =>
51+ import tester ._
52+ val spawned = spawn((" --watch" , " show" , " {foo.fooCommand,bar.barCommand}" ))
5453
55- assertEventually {
56- spawned.err.text().contains(" Computing fooCommand" ) &&
57- spawned.err.text().contains(" Computing barCommand" )
58- }
54+ assertEventually {
55+ spawned.err.text().contains(" Computing fooCommand" ) &&
56+ spawned.err.text().contains(" Computing barCommand" )
57+ }
5958
60- spawned.clear()
61- modifyFile(workspacePath / " bar/bar.txt" , _ + " !" )
62- assertEventually {
63- ! spawned.err.text().contains(" Computing fooCommand" ) &&
64- spawned.err.text().contains(" Computing barCommand" )
65- }
59+ spawned.clear()
60+ modifyFile(workspacePath / " bar/bar.txt" , _ + " !" )
61+ assertEventually {
62+ ! spawned.err.text().contains(" Computing fooCommand" ) &&
63+ spawned.err.text().contains(" Computing barCommand" )
64+ }
6665
67- spawned.clear()
68- modifyFile(workspacePath / " foo/foo.txt" , _ + " !" )
69- assertEventually {
70- spawned.err.text().contains(" Computing fooCommand" ) &&
71- ! spawned.err.text().contains(" Computing barCommand" )
72- }
66+ spawned.clear()
67+ modifyFile(workspacePath / " foo/foo.txt" , _ + " !" )
68+ assertEventually {
69+ spawned.err.text().contains(" Computing fooCommand" ) &&
70+ ! spawned.err.text().contains(" Computing barCommand" )
7371 }
7472 }
73+ }
7574
76- test(" changed-code" ) - retry(1 ) {
77- integrationTest { tester =>
78- import tester ._
75+ test(" changed-code" ) - retry(1 ) {
76+ integrationTest { tester =>
77+ import tester ._
7978
80- val spawned = spawn((" --watch" , " {foo.fooCommand,bar.barCommand}" ))
79+ val spawned = spawn((" --watch" , " {foo.fooCommand,bar.barCommand}" ))
8180
82- assertEventually {
83- spawned.out.text().contains(
84- " Computing fooCommand"
85- ) && spawned.out.text().contains(" Computing barCommand" )
86- }
81+ assertEventually {
82+ spawned.out.text().contains(
83+ " Computing fooCommand"
84+ ) && spawned.out.text().contains(" Computing barCommand" )
85+ }
8786
88- // Check method body code changes correctly trigger downstream evaluation
89- spawned.clear()
90- modifyFile(workspacePath / " build.mill" , _.replace(" \" barHelper \" " , " \" barHelper! \" " ))
91- assertEventually {
92- ! spawned.out.text().contains(" Computing fooCommand" ) &&
93- spawned.out.text().contains(" Computing barCommand" )
94- }
87+ // Check method body code changes correctly trigger downstream evaluation
88+ spawned.clear()
89+ modifyFile(workspacePath / " build.mill" , _.replace(" \" barHelper \" " , " \" barHelper! \" " ))
90+ assertEventually {
91+ ! spawned.out.text().contains(" Computing fooCommand" ) &&
92+ spawned.out.text().contains(" Computing barCommand" )
93+ }
9594
96- // Check module body code changes correctly trigger downstream evaluation
97- spawned.clear()
98- modifyFile(
99- workspacePath / " build.mill" ,
100- _.replace(" object foo extends Module {" , " object foo extends Module { println(123)" )
101- )
102- assertEventually {
103- spawned.out.text().contains(" Computing fooCommand" ) &&
104- ! spawned.out.text().contains(" Computing barCommand" )
105- }
95+ // Check module body code changes correctly trigger downstream evaluation
96+ spawned.clear()
97+ modifyFile(
98+ workspacePath / " build.mill" ,
99+ _.replace(" object foo extends Module {" , " object foo extends Module { println(123)" )
100+ )
101+ assertEventually {
102+ spawned.out.text().contains(" Computing fooCommand" ) &&
103+ ! spawned.out.text().contains(" Computing barCommand" )
106104 }
107105 }
108106 }
0 commit comments