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.
chore: global turbo tests (vercel#3011)
Some quick integration tests to check on the shim logic
- Loading branch information
1 parent
f3876c4
commit 0816a51
Showing
6 changed files
with
54 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
echo $@ |
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,3 @@ | ||
{ | ||
"name": "turbo" | ||
} |
4 changes: 4 additions & 0 deletions
4
cli/integration_tests/global_turbo/repo_with_local/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,4 @@ | ||
{ | ||
"name": "test-turbo-project", | ||
"version" "0.0.1" | ||
} |
Empty file.
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,8 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]}) | ||
VERSION=$1 | ||
mkdir -p node_modules/turbo node_modules/.bin | ||
cp -a ${SCRIPT_DIR}/repo_with_local/. $(pwd)/ | ||
cat ${SCRIPT_DIR}/package_template.json | jq --argjson ver \"${VERSION}\" '{ name: .name, version: $ver}' > node_modules/turbo/package.json | ||
cp ${SCRIPT_DIR}/mock_turbo.sh node_modules/.bin/turbo |
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,37 @@ | ||
Setup | ||
$ . ${TESTDIR}/../setup.sh | ||
|
||
Make sure we use local and don't pass --skip-infer to old binary | ||
$ . ${TESTDIR}/setup.sh 1.2.3 | ||
$ ${TURBO} build --filter foo | ||
Running local turbo binary in .*node_modules/.bin/turbo (re) | ||
|
||
build --filter foo --single-package -- | ||
|
||
Make sure we use local and pass --skip-infer to newer binary | ||
$ . ${TESTDIR}/setup.sh 1.8.9 | ||
$ ${TURBO} build --filter foo | ||
Running local turbo binary in .*node_modules/.bin/turbo (re) | ||
|
||
--skip-infer build --filter foo --single-package -- | ||
|
||
It finds repo root and uses correct version | ||
$ cd subdir | ||
$ ${TURBO} build --filter foo | ||
Running local turbo binary in .*node_modules/.bin/turbo (re) | ||
|
||
--skip-infer build --filter foo --single-package -- | ||
$ cd .. | ||
|
||
It respects cwd | ||
$ ROOT=$(pwd); cd .. | ||
$ ${TURBO} build --filter foo --cwd ${ROOT} | ||
Running local turbo binary in .*node_modules/.bin/turbo (re) | ||
|
||
--skip-infer build --filter foo --single-package -- | ||
|
||
It respects cwd and finds repo root | ||
$ ${TURBO} build --filter foo --cwd ${ROOT}/subdir | ||
Running local turbo binary in .*node_modules/.bin/turbo (re) | ||
|
||
--skip-infer build --filter foo --single-package -- |