forked from vercel/turborepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Run Summaries work for Single Package repos (vercel#4387)
Instead of maintaining separate structs for the Single Package case, this PR mutates the RunSummary when it's formatting it for use. Since `isSinglePackage` doesn't change during a run, we don't need to worry about operating on an Run Summary in different states.
- Loading branch information
Showing
12 changed files
with
242 additions
and
106 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
cli/integration_tests/basic_monorepo/run_summary/get-build.sh
This file was deleted.
Oops, something went wrong.
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,9 @@ | ||
#!/bin/bash | ||
|
||
function getSummaryTask() { | ||
cat "$1" | jq ".tasks | map(select(.task == \"$2\")) | .[0]" | ||
} | ||
|
||
function getSummaryTaskId() { | ||
cat "$1" | jq ".tasks | map(select(.taskId == \"$2\")) | .[0]" | ||
} |
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,85 @@ | ||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
$ . ${TESTDIR}/setup.sh $(pwd) | ||
|
||
Check | ||
$ ${TURBO} run build --summarize=true > /dev/null | ||
$ test -d .turbo/runs | ||
$ ls .turbo/runs/*.json | wc -l | ||
\s*1 (re) | ||
|
||
$ source "$TESTDIR/../run-summary-utils.sh" | ||
$ SUMMARY=$(/bin/ls .turbo/runs/*.json | head -n1) | ||
$ TASK_SUMMARY=$(getSummaryTask "$SUMMARY" "build") | ||
|
||
$ cat $SUMMARY | jq '.tasks | length' | ||
1 | ||
$ cat $SUMMARY | jq '.version' | ||
"0" | ||
$ cat $SUMMARY | jq '.executionSummary | keys' | ||
[ | ||
"attempted", | ||
"cached", | ||
"endTime", | ||
"exitCode", | ||
"failed", | ||
"startTime", | ||
"success" | ||
] | ||
|
||
$ cat $SUMMARY | jq '.executionSummary.exitCode' | ||
0 | ||
$ cat $SUMMARY | jq '.executionSummary.attempted' | ||
1 | ||
$ cat $SUMMARY | jq '.executionSummary.cached' | ||
0 | ||
$ cat $SUMMARY | jq '.executionSummary.failed' | ||
0 | ||
$ cat $SUMMARY | jq '.executionSummary.success' | ||
1 | ||
$ cat $SUMMARY | jq '.executionSummary.startTime' | ||
[0-9]+ (re) | ||
$ cat $SUMMARY | jq '.executionSummary.endTime' | ||
[0-9]+ (re) | ||
|
||
$ echo $TASK_SUMMARY | jq 'keys' | ||
[ | ||
"cacheState", | ||
"command", | ||
"commandArguments", | ||
"dependencies", | ||
"dependents", | ||
"environmentVariables", | ||
"excludedOutputs", | ||
"execution", | ||
"expandedInputs", | ||
"expandedOutputs", | ||
"framework", | ||
"hash", | ||
"hashOfExternalDependencies", | ||
"logFile", | ||
"outputs", | ||
"resolvedTaskDefinition", | ||
"task" | ||
] | ||
|
||
$ echo $TASK_SUMMARY | jq '.execution' | ||
{ | ||
"startTime": [0-9]+, (re) | ||
"endTime": [0-9]+, (re) | ||
"status": "built", | ||
"error": null, | ||
"exitCode": 0 | ||
} | ||
$ echo $TASK_SUMMARY | jq '.commandArguments' | ||
[] | ||
$ echo $TASK_SUMMARY | jq '.expandedOutputs' | ||
[ | ||
".turbo/turbo-build.log", | ||
"foo" | ||
] | ||
$ echo $TASK_SUMMARY | jq '.cacheState' | ||
{ | ||
"local": false, | ||
"remote": false | ||
} |
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
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
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
Oops, something went wrong.