-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d008b30
commit 0b14b5f
Showing
10 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/1-baseline.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/2-update-pipeline.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV", "NEW_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/3-update-global-env.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt"], | ||
"globalEnv": ["SOME_ENV_VAR", "NEW_ENV"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/4-update-global-deps.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo*.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/5-update-global-deps-materially.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt", "bar.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
cli/integration_tests/edit_turbo_json/fixture-configs/6-update-passthrough-env.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,20 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"experimentalGlobalPassThroughEnv": ["PASSTHROUGH"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/a-baseline.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["banana.txt", "apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
cli/integration_tests/edit_turbo_json/fixture-configs/b-change-only-my-app.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,19 @@ | ||
{ | ||
"$schema": "https://turbo.build/schema.json", | ||
"globalDependencies": ["foo.txt"], | ||
"globalEnv": ["SOME_ENV_VAR"], | ||
"pipeline": { | ||
"build": { | ||
"env": ["NODE_ENV"], | ||
"outputs": [] | ||
}, | ||
"my-app#build": { | ||
"outputs": ["apple.json"] | ||
}, | ||
|
||
"something": {}, | ||
"//#something": {}, | ||
|
||
"maybefails": {} | ||
} | ||
} |
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,32 @@ | ||
Setup | ||
$ . ${TESTDIR}/../_helpers/setup.sh | ||
$ . ${TESTDIR}/../_helpers/setup_monorepo.sh $(pwd) | ||
|
||
Baseline global hash | ||
$ cp "$TESTDIR/fixture-configs/1-baseline.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ BASELINE=$(${TURBO} build -vv 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh") | ||
|
||
Update pipeline: global hash remains stable. | ||
$ cp "$TESTDIR/fixture-configs/2-update-pipeline.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ UPDATE_PIPELINE=$(${TURBO} build -vv --experimental-env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh") | ||
$ test $BASELINE = $UPDATE_PIPELINE | ||
|
||
Update globalEnv: global hash changes. | ||
$ cp "$TESTDIR/fixture-configs/3-update-global-env.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ NEW_GLOBAL_ENV=$(${TURBO} build -vv --experimental-env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh") | ||
$ test $BASELINE != $NEW_GLOBAL_ENV | ||
|
||
Update globalDeps in a non-material way: global hash remains stable. | ||
$ cp "$TESTDIR/fixture-configs/4-update-global-deps.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ NEW_GLOBAL_DEPS=$(${TURBO} build -vv --experimental-env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh") | ||
$ test $BASELINE = $NEW_GLOBAL_DEPS | ||
|
||
Update globalDeps in a material way: global hash changes. | ||
$ cp "$TESTDIR/fixture-configs/5-update-global-deps-materially.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ NEW_GLOBAL_DEPS=$(${TURBO} build -vv --experimental-env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh") | ||
$ test $BASELINE != $NEW_GLOBAL_DEPS | ||
|
||
Update passthroughEnv: global hash changes. | ||
$ cp "$TESTDIR/fixture-configs/6-update-passthrough-env.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ NEW_GLOBAL_PASSTHROUGH=$(${TURBO} build -vv --experimental-env-mode=infer 2>&1 | "$TESTDIR/../_helpers/get-global-hash.sh") | ||
$ test $BASELINE != $NEW_GLOBAL_PASSTHROUGH |
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,35 @@ | ||
Setup | ||
$ . ${TESTDIR}/../_helpers/setup.sh | ||
$ . ${TESTDIR}/../_helpers/setup_monorepo.sh $(pwd) | ||
|
||
Baseline task hashes | ||
$ cp "$TESTDIR/fixture-configs/a-baseline.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ ${TURBO} build --dry=json | jq -r '.tasks | sort_by(.taskId)[] | {taskId, hash}' | ||
{ | ||
"taskId": "another#build", | ||
"hash": "4c4f0e076ebc3a2a" | ||
} | ||
{ | ||
"taskId": "my-app#build", | ||
"hash": "9431e2a02286769a" | ||
} | ||
{ | ||
"taskId": "util#build", | ||
"hash": "e6ceb7aa9a6948f8" | ||
} | ||
|
||
Change only my-app#build | ||
$ cp "$TESTDIR/fixture-configs/b-change-only-my-app.json" "$(pwd)/turbo.json" && git commit -am "no comment" --quiet | ||
$ ${TURBO} build --dry=json | jq -r '.tasks | sort_by(.taskId)[] | {taskId, hash}' | ||
{ | ||
"taskId": "another#build", | ||
"hash": "4c4f0e076ebc3a2a" | ||
} | ||
{ | ||
"taskId": "my-app#build", | ||
"hash": "WAT" | ||
} | ||
{ | ||
"taskId": "util#build", | ||
"hash": "e6ceb7aa9a6948f8" | ||
} |