-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into sokra/web-492-handle-if-statements
- Loading branch information
Showing
38 changed files
with
706 additions
and
811 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
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,109 @@ | ||
|
||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
$ . ${TESTDIR}/setup.sh $(pwd) complex | ||
|
||
# Workspace Graph: | ||
# app-a -> lib-a | ||
# \ | ||
# -> lib-b -> lib-d | ||
# / | ||
# app-b -> | ||
# \ ->lib-c | ||
# app-a depends on lib-a | ||
# app-b depends on lib-b, lib-c | ||
# lib-a depends on lib-b | ||
# lib-b depends on lib-d | ||
|
||
We can scope the run to specific packages | ||
$ ${TURBO} run build1 --filter=app-b --graph | ||
|
||
digraph { | ||
\tcompound = "true" (esc) | ||
\tnewrank = "true" (esc) | ||
\tsubgraph "root" { (esc) | ||
\t\t"[root] ___ROOT___#build1" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] app-b#build1" -> "[root] lib-b#build1" (esc) | ||
\t\t"[root] app-b#build1" -> "[root] lib-c#build1" (esc) | ||
\t\t"[root] lib-b#build1" -> "[root] lib-d#build1" (esc) | ||
\t\t"[root] lib-c#build1" -> "[root] ___ROOT___#build1" (esc) | ||
\t\t"[root] lib-d#build1" -> "[root] ___ROOT___#build1" (esc) | ||
\t} (esc) | ||
} | ||
|
||
Can't depend on unknown tasks | ||
$ ${TURBO} run build2 | ||
ERROR run failed: error preparing engine: Could not find task "workspace-a#custom" in pipeline | ||
Turbo error: error preparing engine: Could not find task "workspace-a#custom" in pipeline | ||
[1] | ||
|
||
Can't depend on tasks from unknown packages | ||
$ ${TURBO} run build3 | ||
ERROR run failed: error preparing engine: Could not find task "unknown#custom" in pipeline | ||
Turbo error: error preparing engine: Could not find task "unknown#custom" in pipeline | ||
[1] | ||
|
||
|
||
Complex dependency chain | ||
$ ${TURBO} run test --graph | ||
|
||
digraph { | ||
\tcompound = "true" (esc) | ||
\tnewrank = "true" (esc) | ||
\tsubgraph "root" { (esc) | ||
\t\t"[root] ___ROOT___#build0" -> "[root] ___ROOT___#prepare" (esc) | ||
\t\t"[root] ___ROOT___#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] app-a#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] app-a#test" -> "[root] app-a#prepare" (esc) | ||
\t\t"[root] app-a#test" -> "[root] lib-a#build0" (esc) | ||
\t\t"[root] app-b#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] app-b#test" -> "[root] app-b#prepare" (esc) | ||
\t\t"[root] app-b#test" -> "[root] lib-b#build0" (esc) | ||
\t\t"[root] app-b#test" -> "[root] lib-c#build0" (esc) | ||
\t\t"[root] lib-a#build0" -> "[root] lib-a#prepare" (esc) | ||
\t\t"[root] lib-a#build0" -> "[root] lib-b#build0" (esc) | ||
\t\t"[root] lib-a#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-a#test" -> "[root] lib-a#prepare" (esc) | ||
\t\t"[root] lib-a#test" -> "[root] lib-b#build0" (esc) | ||
\t\t"[root] lib-b#build0" -> "[root] lib-b#prepare" (esc) | ||
\t\t"[root] lib-b#build0" -> "[root] lib-d#build0" (esc) | ||
\t\t"[root] lib-b#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-b#test" -> "[root] lib-b#prepare" (esc) | ||
\t\t"[root] lib-b#test" -> "[root] lib-d#build0" (esc) | ||
\t\t"[root] lib-c#build0" -> "[root] ___ROOT___#build0" (esc) | ||
\t\t"[root] lib-c#build0" -> "[root] lib-c#prepare" (esc) | ||
\t\t"[root] lib-c#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-c#test" -> "[root] ___ROOT___#build0" (esc) | ||
\t\t"[root] lib-c#test" -> "[root] lib-c#prepare" (esc) | ||
\t\t"[root] lib-d#build0" -> "[root] ___ROOT___#build0" (esc) | ||
\t\t"[root] lib-d#build0" -> "[root] lib-d#prepare" (esc) | ||
\t\t"[root] lib-d#prepare" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-d#test" -> "[root] ___ROOT___#build0" (esc) | ||
\t\t"[root] lib-d#test" -> "[root] lib-d#prepare" (esc) | ||
\t} (esc) | ||
} | ||
|
||
|
||
Check that --only only runs leaf tasks | ||
$ ${TURBO} run test --only --graph | ||
|
||
digraph { | ||
\tcompound = "true" (esc) | ||
\tnewrank = "true" (esc) | ||
\tsubgraph "root" { (esc) | ||
\t\t"[root] app-a#test" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] app-b#test" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-a#test" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-b#test" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-c#test" -> "[root] ___ROOT___" (esc) | ||
\t\t"[root] lib-d#test" -> "[root] ___ROOT___" (esc) | ||
\t} (esc) | ||
} | ||
|
||
Can't depend on itself | ||
$ ${TURBO} run build4 | ||
ERROR run failed: error preparing engine: Invalid task dependency graph: | ||
.*#build4 depends on itself (re) | ||
Turbo error: error preparing engine: Invalid task dependency graph: | ||
.*#build4 depends on itself (re) | ||
[1] |
10 changes: 10 additions & 0 deletions
10
cli/integration_tests/task-dependencies/complex/app-a/package.json
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,10 @@ | ||
{ | ||
"name": "app-a", | ||
"scripts": { | ||
"build": "echo 'build app-a'", | ||
"test": "echo 'test app-a'" | ||
}, | ||
"dependencies": { | ||
"lib-a": "*" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
cli/integration_tests/task-dependencies/complex/app-b/package.json
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,11 @@ | ||
{ | ||
"name": "app-b", | ||
"scripts": { | ||
"build": "echo 'build app-b'", | ||
"test": "echo 'test app-b'" | ||
}, | ||
"dependencies": { | ||
"lib-b": "*", | ||
"lib-c": "*" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
cli/integration_tests/task-dependencies/complex/lib-a/package.json
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,10 @@ | ||
{ | ||
"name": "lib-a", | ||
"scripts": { | ||
"build": "echo 'build lib-a'", | ||
"test": "echo 'test lib-a'" | ||
}, | ||
"dependencies": { | ||
"lib-b": "*" | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
cli/integration_tests/task-dependencies/complex/lib-b/package.json
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,10 @@ | ||
{ | ||
"name": "lib-b", | ||
"scripts": { | ||
"build": "echo 'build lib-b'", | ||
"test": "echo 'test lib-b'" | ||
}, | ||
"dependencies": { | ||
"lib-d": "*" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
cli/integration_tests/task-dependencies/complex/lib-c/package.json
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,6 @@ | ||
{ | ||
"name": "lib-c", | ||
"scripts": { | ||
"build": "echo 'build lib-c'" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
cli/integration_tests/task-dependencies/complex/lib-d/package.json
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,7 @@ | ||
{ | ||
"name": "lib-d", | ||
"scripts": { | ||
"build": "echo 'build lib-d'", | ||
"test": "echo 'test lib-d'" | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
cli/integration_tests/task-dependencies/complex/package.json
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,11 @@ | ||
{ | ||
"name": "unknown-dependency", | ||
"workspaces": [ | ||
"app-a", | ||
"app-b", | ||
"lib-a", | ||
"lib-b", | ||
"lib-c", | ||
"lib-d" | ||
] | ||
} |
30 changes: 30 additions & 0 deletions
30
cli/integration_tests/task-dependencies/complex/turbo.json
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,30 @@ | ||
{ | ||
"pipeline": { | ||
"build0": { | ||
"dependsOn": ["^build0", "prepare"] | ||
}, | ||
"test": { | ||
"dependsOn": ["^build0", "prepare"] | ||
}, | ||
"prepare": {}, | ||
"side-quest": { | ||
"dependsOn": ["prepare"] | ||
}, | ||
|
||
"build1": { | ||
"dependsOn": ["^build1"] | ||
}, | ||
|
||
"build2": { | ||
"dependsOn": ["workspace-a#custom"] | ||
}, | ||
|
||
"build3": { | ||
"dependsOn": ["unknown#custom"] | ||
}, | ||
|
||
"build4": { | ||
"dependsOn": ["build4"] | ||
} | ||
} | ||
} |
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,41 @@ | ||
|
||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
$ . ${TESTDIR}/setup.sh $(pwd) overwriting | ||
|
||
Test | ||
$ ${TURBO} run build > tmp.log | ||
$ cat tmp.log | grep "Packages in scope" -A2 | ||
\xe2\x80\xa2 Packages in scope: workspace-a, workspace-b (esc) | ||
\xe2\x80\xa2 Running build in 2 packages (esc) | ||
\xe2\x80\xa2 Remote caching disabled (esc) | ||
|
||
# workspace-a#generate ran | ||
$ cat tmp.log | grep "workspace-a:generate" | ||
workspace-a:generate: cache miss, executing 38a94e8f72e48200 | ||
workspace-a:generate: | ||
workspace-a:generate: > generate | ||
workspace-a:generate: > echo 'generate workspace-a' | ||
workspace-a:generate: | ||
workspace-a:generate: generate workspace-a | ||
workspace-a#build ran | ||
$ cat tmp.log | grep "workspace-a:build" | ||
workspace-a:build: cache miss, executing cdf4f35b3e5ff342 | ||
workspace-a:build: | ||
workspace-a:build: > build | ||
workspace-a:build: > echo 'build workspace-a' | ||
workspace-a:build: | ||
workspace-a:build: build workspace-a | ||
|
||
workspace-b#generate DID NOT run | ||
$ cat tmp.log | grep "workspace-b:generate" | ||
[1] | ||
|
||
workspace-b#build ran | ||
$ cat tmp.log | grep "workspace-b:build" | ||
workspace-b:build: cache miss, executing 35d38d74bf7b33db | ||
workspace-b:build: | ||
workspace-b:build: > build | ||
workspace-b:build: > echo 'build workspace-b' | ||
workspace-b:build: | ||
workspace-b:build: build workspace-b |
7 changes: 7 additions & 0 deletions
7
cli/integration_tests/task-dependencies/overwriting/package.json
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,7 @@ | ||
{ | ||
"name": "overwriting", | ||
"workspaces": [ | ||
"workspace-a", | ||
"workspace-b" | ||
] | ||
} |
11 changes: 11 additions & 0 deletions
11
cli/integration_tests/task-dependencies/overwriting/turbo.json
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,11 @@ | ||
{ | ||
"pipeline": { | ||
"build": { | ||
"dependsOn": ["generate"] | ||
}, | ||
"generate": {}, | ||
"workspace-b#build": { | ||
"dependsOn": [] | ||
} | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
cli/integration_tests/task-dependencies/overwriting/workspace-a/package.json
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,7 @@ | ||
{ | ||
"name": "workspace-a", | ||
"scripts": { | ||
"build": "echo 'build workspace-a'", | ||
"generate": "echo 'generate workspace-a'" | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
cli/integration_tests/task-dependencies/overwriting/workspace-b/package.json
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,7 @@ | ||
{ | ||
"name": "workspace-b", | ||
"scripts": { | ||
"build": "echo 'build workspace-b'", | ||
"generate": "echo 'generate workspace-b'" | ||
} | ||
} |
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
Oops, something went wrong.