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.
Try out cram/prysk for CLI integration testing (vercel#1829)
Add some `prysk`-based integration tests. They're minimal for now, but we can expand them as we work on CLI UX. This PR also fixes an incorrect error that was printed out from `turbo logout`, found via CLI test. These are not yet wired to CI. I'd like to let them bake for a bit to make sure they are useful before we start gating releases on them. They can be run via `make integration-tests` in the `cli` package. [Prysk](https://github.com/Nicoretti/prysk)
- Loading branch information
Greg Soltis
authored
Sep 8, 2022
1 parent
28310c4
commit bfb6193
Showing
9 changed files
with
89 additions
and
2 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 |
---|---|---|
|
@@ -9,4 +9,5 @@ | |
/turbo-new.exe | ||
/turbo.exe | ||
|
||
/scripts/turbo-* | ||
/scripts/turbo-* | ||
/.cram_env |
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,14 @@ | ||
#!/bin/sh | ||
|
||
read -r -d '' CONFIG <<- EOF | ||
{ | ||
"token": "normal-user-token" | ||
} | ||
EOF | ||
|
||
USER_CONFIG_HOME=$(mktemp -d -t turbo-XXXXXXXXXX) | ||
# duplicate over to XDG var so that turbo picks it up | ||
export XDG_CONFIG_HOME=$USER_CONFIG_HOME | ||
|
||
mkdir -p $USER_CONFIG_HOME/turborepo | ||
echo $CONFIG > $USER_CONFIG_HOME/turborepo/config.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,12 @@ | ||
Setup | ||
$ . ${TESTDIR}/setup.sh | ||
$ . ${TESTDIR}/logged_in.sh | ||
|
||
Logout while logged in | ||
$ ${TURBO} logout | ||
>>> Logged out | ||
|
||
Logout while logged out | ||
$ ${TURBO} logout | ||
>>> Logged out | ||
|
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/sh | ||
TURBO=${TESTDIR}/../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,31 @@ | ||
Setup | ||
$ . ${TESTDIR}/setup.sh | ||
|
||
Test help flag | ||
$ ${TURBO} -h | ||
Usage: turbo [--version] [--help] <command> [<args>] | ||
|
||
Available commands are: | ||
bin Get the path to the Turbo binary | ||
daemon Runs turbod | ||
link Link your local directory to a Vercel organization and enable remote caching. | ||
login Login to your Vercel account | ||
logout Logout of your Vercel account | ||
prune Prepare a subset of your monorepo. | ||
run Run tasks across projects in your monorepo | ||
unlink Unlink the current directory from your Vercel organization and disable Remote Caching | ||
|
||
|
||
$ ${TURBO} --help | ||
Usage: turbo [--version] [--help] <command> [<args>] | ||
|
||
Available commands are: | ||
bin Get the path to the Turbo binary | ||
daemon Runs turbod | ||
link Link your local directory to a Vercel organization and enable remote caching. | ||
login Login to your Vercel account | ||
logout Logout of your Vercel account | ||
prune Prepare a subset of your monorepo. | ||
run Run tasks across projects in your monorepo | ||
unlink Unlink the current directory from your Vercel organization and disable Remote Caching | ||
|
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 @@ | ||
Setup | ||
$ . ${TESTDIR}/setup.sh | ||
|
||
Test version | ||
$ ${TURBO} --version | ||
(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ (re) | ||
|
||
Semver Regex source: https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string | ||
TODO: resolve ambiguity | ||
$ ${TURBO} -v |
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