-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(integration): use offline install (#9599)
### Description This PR does 3 things: - Switch to use `--offline` when performing `npm install` to ensure we are only using internal packages in our fixtures. We only do it for `npm` as it lacks a `workspace` protocol. - Add a `util` package that we were referencing in our nested workspace fixture - Add `--no-install` flag for tests that don't need to install deps. Currently only used for our framework inference test where the presence of `next` in a `package.json` is all we need. We never actually need `next`. ### Testing Instructions Passes in CI
- Loading branch information
1 parent
11b6c37
commit f0cd0fd
Showing
5 changed files
with
29 additions
and
8 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 |
---|---|---|
|
@@ -2,14 +2,30 @@ | |
|
||
set -eo pipefail | ||
|
||
FIXTURE_NAME="${1-basic_monorepo}" | ||
INSTALL_DEPS=true | ||
ARGS=() | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
--no-install) | ||
INSTALL_DEPS=false | ||
shift # past the option | ||
;; | ||
*) | ||
ARGS+=("$1") | ||
shift | ||
esac | ||
done | ||
|
||
|
||
FIXTURE_NAME="${ARGS[0]-basic_monorepo}" | ||
|
||
# Default to version of npm installed with Node 18.20.2 | ||
# If CI is failing, check that this version is the same as | ||
# the CI runner's version of npm | ||
PACKAGE_MANAGER="[email protected]" | ||
if [[ $2 != "" ]]; then | ||
PACKAGE_MANAGER="$2" | ||
if [[ "${ARGS[1]}" != "" ]]; then | ||
PACKAGE_MANAGER="${ARGS[1]}" | ||
fi | ||
|
||
THIS_DIR=$(dirname "${BASH_SOURCE[0]}") | ||
|
@@ -28,7 +44,9 @@ fi | |
"${TURBOREPO_TESTS_DIR}/helpers/copy_fixture.sh" "${TARGET_DIR}" "${FIXTURE_NAME}" "${TURBOREPO_TESTS_DIR}/integration/fixtures" | ||
"${TURBOREPO_TESTS_DIR}/helpers/setup_git.sh" "${TARGET_DIR}" | ||
"${TURBOREPO_TESTS_DIR}/helpers/setup_package_manager.sh" "${TARGET_DIR}" "$PACKAGE_MANAGER" | ||
"${TURBOREPO_TESTS_DIR}/helpers/install_deps.sh" "$PACKAGE_MANAGER" | ||
if $INSTALL_DEPS; then | ||
"${TURBOREPO_TESTS_DIR}/helpers/install_deps.sh" "$PACKAGE_MANAGER" | ||
fi | ||
|
||
# Set TURBO env var, it is used by tests to run the binary | ||
if [[ "${OSTYPE}" == "msys" ]]; then | ||
|
3 changes: 3 additions & 0 deletions
3
turborepo-tests/integration/fixtures/nested_packages/packages/util/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,3 @@ | ||
{ | ||
"name": "util" | ||
} |
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