Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polish the shape of the Run Summary JSON #4421

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli/integration_tests/basic_monorepo/cache_state.t
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run a build to get a local cache.


Validate cache state according to dry-run
$ ${TURBO} run build --dry=json | jq '.tasks | map(select(.taskId == "my-app#build")) | .[0].cacheState'
$ ${TURBO} run build --dry=json | jq '.tasks | map(select(.taskId == "my-app#build")) | .[0].cache'
{
"local": true,
"remote": false
Expand Down
40 changes: 20 additions & 20 deletions cli/integration_tests/basic_monorepo/dry_run_json.t
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ Setup
$ cat tmpjson.log | jq .turboVersion
"[a-z0-9\.-]+" (re)

$ cat tmpjson.log | jq .globalHashSummary
$ cat tmpjson.log | jq .globalCacheInputs
{
"globalFileHashMap": {
"rootKey": "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo",
"files": {
"foo.txt": "eebae5f3ca7b5831e429e947b7d61edd0de69236"
},
"rootExternalDepsHash": "ccab0b28617f1f56",
"globalCacheKey": "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo",
"pipeline": {
"hashOfExternalDependencies": "ccab0b28617f1f56",
"rootPipeline": {
"//#something": {
"outputs": [],
"cache": true,
Expand Down Expand Up @@ -72,7 +72,7 @@ Setup

$ cat tmpjson.log | jq 'keys'
[
"globalHashSummary",
"globalCacheInputs",
"id",
"packages",
"tasks",
Expand All @@ -87,12 +87,16 @@ Setup
"task": "build",
"package": "my-app",
"hash": "2f192ed93e20f940",
"cacheState": {
"inputs": {
"package.json": "6bcf57fd6ff30d1a6f40ad8d8d08e8b940fc7e3b"
},
"hashOfExternalDependencies": "ccab0b28617f1f56",
"cache": {
"local": false,
"remote": false
},
"command": "echo 'building'",
"commandArguments": [],
"cliArguments": [],
"outputs": [
"apple.json",
"banana.txt"
Expand All @@ -114,9 +118,6 @@ Setup
"env": [],
"persistent": false
},
"expandedInputs": {
"package.json": "6bcf57fd6ff30d1a6f40ad8d8d08e8b940fc7e3b"
},
"expandedOutputs": [],
"framework": "<NO FRAMEWORK DETECTED>",
"environmentVariables": {
Expand All @@ -126,8 +127,7 @@ Setup
"SOME_ENV_VAR=",
"VERCEL_ANALYTICS_ID="
]
},
"hashOfExternalDependencies": "ccab0b28617f1f56"
}
}

# Validate output of util#build task
Expand All @@ -137,12 +137,16 @@ Setup
"task": "build",
"package": "util",
"hash": "af2ba2d52192ee45",
"cacheState": {
"inputs": {
"package.json": "4d57bb28c9967640d812981198a743b3188f713e"
},
"hashOfExternalDependencies": "ccab0b28617f1f56",
"cache": {
"local": false,
"remote": false
},
"command": "echo 'building'",
"commandArguments": [],
"cliArguments": [],
"outputs": null,
"excludedOutputs": null,
"logFile": "packages/util/.turbo/turbo-build.log",
Expand All @@ -160,9 +164,6 @@ Setup
],
"persistent": false
},
"expandedInputs": {
"package.json": "4d57bb28c9967640d812981198a743b3188f713e"
},
"expandedOutputs": [],
"framework": "<NO FRAMEWORK DETECTED>",
"environmentVariables": {
Expand All @@ -174,8 +175,7 @@ Setup
"SOME_ENV_VAR=",
"VERCEL_ANALYTICS_ID="
]
},
"hashOfExternalDependencies": "ccab0b28617f1f56"
}
}

Run again with NODE_ENV set and see the value in the summary. --filter=util workspace so the output is smaller
Expand Down
22 changes: 10 additions & 12 deletions cli/integration_tests/basic_monorepo/run_summary/run_summary.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,19 @@ Setup
2
$ cat $FIRST | jq '.version'
"0"
$ cat $FIRST | jq '.executionSummary.exitCode'
$ cat $FIRST | jq '.execution.exitCode'
0
$ cat $FIRST | jq '.executionSummary.attempted'
$ cat $FIRST | jq '.execution.attempted'
2
$ cat $FIRST | jq '.executionSummary.cached'
$ cat $FIRST | jq '.execution.cached'
0
$ cat $FIRST | jq '.executionSummary.failed'
$ cat $FIRST | jq '.execution.failed'
0
$ cat $FIRST | jq '.executionSummary.success'
$ cat $FIRST | jq '.execution.success'
2
$ cat $FIRST | jq '.executionSummary.startTime'
$ cat $FIRST | jq '.execution.startTime'
[0-9]+ (re)
$ cat $FIRST | jq '.executionSummary.endTime'
$ cat $FIRST | jq '.execution.endTime'
[0-9]+ (re)

# Extract some task-specific summaries from each
Expand All @@ -59,11 +59,10 @@ Setup
{
"startTime": [0-9]+, (re)
"endTime": [0-9]+, (re)
"status": "built",
"error": null,
"exitCode": 0
}
$ echo $FIRST_APP_BUILD | jq '.commandArguments'
$ echo $FIRST_APP_BUILD | jq '.cliArguments'
[
"someargs"
]
Expand All @@ -74,12 +73,12 @@ Setup
"apps/my-app/.turbo/turbo-build.log"
]
# validate that cache state updates in second run
$ echo $FIRST_APP_BUILD | jq '.cacheState'
$ echo $FIRST_APP_BUILD | jq '.cache'
{
"local": false,
"remote": false
}
$ echo $SECOND_APP_BUILD | jq '.cacheState'
$ echo $SECOND_APP_BUILD | jq '.cache'
{
"local": true,
"remote": false
Expand All @@ -90,7 +89,6 @@ Setup
{
"startTime": [0-9]+, (re)
"endTime": [0-9]+, (re)
"status": "built",
"error": null,
"exitCode": 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ The maybefails task fails for one workspace but not the other
{
"startTime": [0-9]+, (re)
"endTime": [0-9]+, (re)
"status": "buildFailed",
"error": {},
"exitCode": 1
}
Expand All @@ -26,7 +25,6 @@ The maybefails task fails for one workspace but not the other
{
"startTime": [0-9]+, (re)
"endTime": [0-9]+, (re)
"status": "built",
"error": null,
"exitCode": 0
}
32 changes: 16 additions & 16 deletions cli/integration_tests/single_package/dry-run.t
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Check
"id": "[a-zA-Z0-9]+", (re)
"version": "0",
"turboVersion": "[a-z0-9\.-]+", (re)
"globalHashSummary": {
"globalFileHashMap": {
"globalCacheInputs": {
"rootKey": "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo",
"files": {
"package-lock.json": "8db0df575e6509336a6719094b63eb23d2c649c1",
"package.json": "185771929d92c3865ce06c863c07d357500d3364",
"somefile.txt": "45b983be36b73c0788dc9cbcb76cbb80fc7bb057"
},
"rootExternalDepsHash": "",
"globalCacheKey": "Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo",
"pipeline": {
"hashOfExternalDependencies": "",
"rootPipeline": {
"//#build": {
"outputs": [
"foo"
Expand All @@ -60,12 +60,20 @@ Check
{
"task": "build",
"hash": "dd4a9a7b508b0e38",
"cacheState": {
"inputs": {
".gitignore": "6f23ff6842b5526da43ab38f4a5bf3b0158eeb42",
"package-lock.json": "8db0df575e6509336a6719094b63eb23d2c649c1",
"package.json": "185771929d92c3865ce06c863c07d357500d3364",
"somefile.txt": "45b983be36b73c0788dc9cbcb76cbb80fc7bb057",
"turbo.json": "505752e75c10f9e7a0d2538cf8b6f0fcfb8980a0"
},
"hashOfExternalDependencies": "",
"cache": {
"local": false,
"remote": false
},
"command": "echo 'building' \u003e foo",
"commandArguments": [],
"cliArguments": [],
"outputs": [
"foo"
],
Expand All @@ -84,13 +92,6 @@ Check
"env": [],
"persistent": false
},
"expandedInputs": {
".gitignore": "6f23ff6842b5526da43ab38f4a5bf3b0158eeb42",
"package-lock.json": "8db0df575e6509336a6719094b63eb23d2c649c1",
"package.json": "185771929d92c3865ce06c863c07d357500d3364",
"somefile.txt": "45b983be36b73c0788dc9cbcb76cbb80fc7bb057",
"turbo.json": "505752e75c10f9e7a0d2538cf8b6f0fcfb8980a0"
},
"expandedOutputs": [],
"framework": "\u003cNO FRAMEWORK DETECTED\u003e",
"environmentVariables": {
Expand All @@ -99,8 +100,7 @@ Check
"global": [
"VERCEL_ANALYTICS_ID="
]
},
"hashOfExternalDependencies": ""
}
}
]
}
27 changes: 13 additions & 14 deletions cli/integration_tests/single_package/run-summary.t
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Check
1
$ cat $SUMMARY | jq '.version'
"0"
$ cat $SUMMARY | jq '.executionSummary | keys'
$ cat $SUMMARY | jq '.execution | keys'
[
"attempted",
"cached",
Expand All @@ -27,36 +27,36 @@ Check
"success"
]

$ cat $SUMMARY | jq '.executionSummary.exitCode'
$ cat $SUMMARY | jq '.execution.exitCode'
0
$ cat $SUMMARY | jq '.executionSummary.attempted'
$ cat $SUMMARY | jq '.execution.attempted'
1
$ cat $SUMMARY | jq '.executionSummary.cached'
$ cat $SUMMARY | jq '.execution.cached'
0
$ cat $SUMMARY | jq '.executionSummary.failed'
$ cat $SUMMARY | jq '.execution.failed'
0
$ cat $SUMMARY | jq '.executionSummary.success'
$ cat $SUMMARY | jq '.execution.success'
1
$ cat $SUMMARY | jq '.executionSummary.startTime'
$ cat $SUMMARY | jq '.execution.startTime'
[0-9]+ (re)
$ cat $SUMMARY | jq '.executionSummary.endTime'
$ cat $SUMMARY | jq '.execution.endTime'
[0-9]+ (re)

$ echo $TASK_SUMMARY | jq 'keys'
[
"cacheState",
"cache",
"cliArguments",
"command",
"commandArguments",
"dependencies",
"dependents",
"environmentVariables",
"excludedOutputs",
"execution",
"expandedInputs",
"expandedOutputs",
"framework",
"hash",
"hashOfExternalDependencies",
"inputs",
"logFile",
"outputs",
"resolvedTaskDefinition",
Expand All @@ -67,18 +67,17 @@ Check
{
"startTime": [0-9]+, (re)
"endTime": [0-9]+, (re)
"status": "built",
"error": null,
"exitCode": 0
}
$ echo $TASK_SUMMARY | jq '.commandArguments'
$ echo $TASK_SUMMARY | jq '.cliArguments'
[]
$ echo $TASK_SUMMARY | jq '.expandedOutputs'
[
".turbo/turbo-build.log",
"foo"
]
$ echo $TASK_SUMMARY | jq '.cacheState'
$ echo $TASK_SUMMARY | jq '.cache'
{
"local": false,
"remote": false
Expand Down
Loading