Skip to content

Commit

Permalink
Add ability to run a single integration test (#4723)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Olszewski <chris.olszewski@vercel.com>
  • Loading branch information
mehulkar and chris-olszewski committed Apr 27, 2023
1 parent b96362a commit 26df3ef
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ Then from the root directory, you can run:
```bash
pnpm test -- --filter=turborepo-tests-integration
```
- A single Integration test
e.g to run everything in `tests/run_summary`:
```
# build first because the next command doesn't run through turbo
pnpm -- turbo run build --filter=cli
pnpm test -F turborepo-tests-integration -- "run_summary"
```
Note: this is not through turbo, so you'll have to build turbo yourself first.
- E2E test
```bash
pnpm -- turbo e2e --filter=cli
Expand Down
2 changes: 1 addition & 1 deletion cli/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"extends": ["//"],
"pipeline": {
"build": {
"env": ["GO_TAG"],
"outputs": ["turbo", "turbo.exe"]
},

"e2e": {
"outputs": [],
"inputs": ["**/*.go", "go.mod", "go.sum", "scripts/e2e/e2e.ts"]
Expand Down
6 changes: 2 additions & 4 deletions turborepo-tests/integration/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
{
"name": "turborepo-tests-integration",
"scripts": {
"test:setup_python": "python3 -m venv .cram_env",
"test:setup_pip": "pnpm test:setup_python && .cram_env/bin/python3 -m pip install --quiet --upgrade pip",
"test:setup_prysk": "pnpm test:setup_pip && .cram_env/bin/pip install prysk",
"test": "pnpm test:setup_prysk && .cram_env/bin/prysk --shell=`which bash` tests",
"test:setup": "./setup.sh",
"test": "./test.sh",
"test:interactive": ".cram_env/bin/prysk -i --shell=`which bash` tests",
"test:parallel": ".cram_env/bin/pytest -n auto tests --prysk-shell=`which bash`",
"pretest:parallel": ".cram_env/bin/pip3 install --quiet pytest \"prysk[pytest-plugin]\" pytest-xdist"
Expand Down
5 changes: 5 additions & 0 deletions turborepo-tests/integration/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

python3 -m venv .cram_env
.cram_env/bin/python3 -m pip install --quiet --upgrade pip
.cram_env/bin/pip install "prysk==0.15.0"
7 changes: 7 additions & 0 deletions turborepo-tests/integration/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

if [ "$1" = "" ]; then
.cram_env/bin/prysk --shell="$(which bash)" tests
else
.cram_env/bin/prysk --shell="$(which bash)" "tests/$1"
fi
8 changes: 6 additions & 2 deletions turborepo-tests/integration/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
"dependsOn": ["^topo"]
},
"test": {
"dependsOn": ["cli#build", "topo"],
"env": ["GO_TAG"]
"dependsOn": ["cli#build", "topo", "test:setup"]
},

"test:setup": {
"inputs": ["setup.sh"],
"outputs": [".cram_env/**"]
}
}
}

0 comments on commit 26df3ef

Please sign in to comment.