这是indexloc提供的服务,不要输入任何密码
Skip to content
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
24 changes: 22 additions & 2 deletions .github/workflows/turborepo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
fi

integration:
name: Turborepo Integration
name: Turborepo Integration (${{ matrix.os.runner }}, ${{ matrix.test-path }})
needs:
- find-changes
runs-on: ${{ matrix.os.runner }}
Expand All @@ -117,6 +117,26 @@ jobs:
- runner: ubuntu-latest
- runner: macos-latest
- runner: windows-latest
test-path:
- clone
- daemon
- dry-json
- edit-turbo-json
- find-turbo
- inference
- jsonc
- lockfile-aware-caching
- persistent-dependencies
- prune
- query
- run
- run-caching
- run-logging
- run-summary
- strict-env-vars
- task-dependencies
- workspace-configs
- other
steps:
# On Windows, set autocrlf to input so that when the repo is cloned down
# the fixtures retain their line endings and don't get updated to CRLF.
Expand Down Expand Up @@ -186,7 +206,7 @@ jobs:
if [ -z "${RUSTC_WRAPPER}" ]; then
unset RUSTC_WRAPPER
fi
turbo run test --filter=turborepo-tests-integration --color --env-mode=strict --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }}
turbo run test --filter=turborepo-tests-integration --color --env-mode=strict --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }} -- "tests/${{ matrix.test-path }}"
shell: bash
env:
SCCACHE_BUCKET: turborepo-sccache
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

Create a new branch
$ git checkout -b my-branch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

Create a new branch
$ git checkout -b my-branch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh

Bad flag should print misuse text
$ ${TURBO} --bad-flag
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

Add turbo.json with unnecessary package task syntax to a package
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd)/apps/my-app "package-task.json"
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd)/apps/my-app "package-task.json"

Run build with package task in non-root turbo.json
$ ${TURBO} build 2> error.txt
Expand Down Expand Up @@ -32,7 +32,7 @@ Remove unnecessary package task syntax
$ rm $(pwd)/apps/my-app/turbo.json

Use our custom turbo config with an invalid env var
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "invalid-env-var.json"
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "invalid-env-var.json"

Run build with invalid env var
$ ${TURBO} build 2> error.txt
Expand Down Expand Up @@ -70,7 +70,7 @@ Run in single package mode even though we have a task with package syntax


Use our custom turbo config which has interruptible: true
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "interruptible-but-not-persistent.json"
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "interruptible-but-not-persistent.json"

Build should fail
$ ${TURBO} run build
Expand All @@ -86,7 +86,7 @@ Build should fail
[1]

Use our custom turbo config with syntax errors
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "syntax-error.json"
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "syntax-error.json"

Run build with syntax errors in turbo.json
$ ${TURBO} build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh --no-install

$ ${TURBO} bin -vvv > out.log 2>&1
$ grep --quiet "Global turbo version: .*" out.log
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../helpers/mock_turbo_config.sh
$ . ${TESTDIR}/../../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/mock_turbo_config.sh

Link Test Run
$ ${TURBO} link --__test-run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh

Login Test Run
$ ${TURBO} login --__test-run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../helpers/mock_turbo_config.sh
$ . ${TESTDIR}/../../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/mock_turbo_config.sh

Logout while logged in
$ ${TURBO} logout
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh --no-install

Run info
$ ${TURBO} ls
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

Write query to file
$ echo 'query { packages { items { name } } }' > query.gql
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../helpers/mock_telemetry_config.sh
$ . ${TESTDIR}/../../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/mock_telemetry_config.sh

Run status (with first run message)
$ TURBO_TELEMETRY_MESSAGE_DISABLED=0 ${TURBO} telemetry status
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh

Unlink Test Run
$ ${TURBO} unlink --__test-run
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh
$ VERSION=${MONOREPO_ROOT_DIR}/version.txt

Test version matches that of version.txt
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh --no-install

Run test run
$ ${TURBO} config
Expand Down Expand Up @@ -44,7 +44,7 @@ Run test run with remote cache timeout from both env and flag (flag should take
456

Use our custom turbo config with an invalid env var
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "invalid-env-var.json"
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "invalid-env-var.json"

Run build with invalid env var
$ ${TURBO} build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh --no-install
$ ${TURBO} run build --daemon --no-daemon
ERROR the argument '--daemon' cannot be used with '--no-daemon'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

# Run the build task with --dry flag and cut up the logs into separate files by empty lines
# https://stackoverflow.com/a/33297878/986415
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh
$ jq '.engines = {"node": ">=12"}' package.json > package.json.new
$ mv package.json.new package.json

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

# Running with --filter works and exits with success
$ ${TURBO} run build --filter="[main]"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh

Make sure exit code is 2 when no args are passed
$ CURR=$(${TURBO} --cwd ${TESTDIR}/../.. bin)
$ CURR=$(${TURBO} --cwd ${TESTDIR}/../../../ bin)
$ diff --strip-trailing-cr <(readlink -f ${TURBO}) <(readlink -f ${CURR})

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh framework_inference --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh framework_inference --no-install

Prove that we start with no inferred variables
$ ${TURBO} run build --dry=json | jq -r '.tasks[].environmentVariables.inferred'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh global_deps
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh global_deps

Run a build
$ ${TURBO} build -F my-app --output-logs=hash-only
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

# Run all tests with --filter=util so we don't have any non-deterministic ordering

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../helpers/replace_turbo_json.sh $(pwd) "interactive.json"
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/replace_turbo_json.sh $(pwd) "interactive.json"
Verify we error on interactive task that hasn't been marked as cache: false
$ ${TURBO} build
x Tasks cannot be marked as interactive and cacheable.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh --no-install
Clear name field
$ jq '.name = ""' apps/my-app/package.json > package.json.new
$ mv apps/my-app/package.json apps/my-app/package.json.old
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

Make sure exit code is 2 when no args are passed
$ ${TURBO}
Expand Down Expand Up @@ -164,7 +164,7 @@ we get the full help output.
The build system that makes ship happen

Initialize a new monorepo
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh composable_config > /dev/null 2>&1
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh composable_config > /dev/null 2>&1

$ ${TURBO} run
No tasks provided, here are some potential ones
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh basic_monorepo "npm@8.19.4" --no-install
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh basic_monorepo "npm@8.19.4" --no-install

Run test run
$ TURBO_LOG_VERBOSITY=off ${TURBO} config | jq .packageManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh passthrough
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh passthrough

$ ${TURBO} -F my-app echo -- hello
\xe2\x80\xa2 Packages in scope: my-app (esc)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

# Run as if called by global turbo
$ TURBO_INVOCATION_DIR=$(pwd)/packages/util ${TURBO} build --skip-infer
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh

sed replaces the square brackets with parentheses so prysk can parse the file path
$ ${TURBO} something 2>&1 | sed 's/\[\([^]]*\)\]/\(\1)/g'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh

Should error if `--cwd` flag doesn't have path passed along with it
$ ${TURBO} foo bar --cwd
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup.sh
$ . ${TESTDIR}/../../../helpers/setup.sh

Test help flag
$ ${TURBO} -h
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Setup
$ . ${TESTDIR}/../../helpers/setup_integration_test.sh turbo_trace
$ . ${TESTDIR}/../../../helpers/setup_integration_test.sh turbo_trace

$ ${TURBO} query "query { file(path: \"main.ts\") { path } }"
WARNING query command is experimental and may change in the future
Expand Down
Loading