diff --git a/turborepo-tests/helpers/setup_package_manager.sh b/turborepo-tests/helpers/setup_package_manager.sh index fd0836045476a..ac564b1bc5109 100755 --- a/turborepo-tests/helpers/setup_package_manager.sh +++ b/turborepo-tests/helpers/setup_package_manager.sh @@ -34,7 +34,9 @@ if [ "$PRYSK_TEMP" == "" ]; then mkdir -p "${COREPACK_INSTALL_DIR}" export PATH=${COREPACK_INSTALL_DIR}:$PATH else - COREPACK_INSTALL_DIR="${PRYSK_TEMP}/corepack" + # When running prysk via pytest PRYSK_TEMP == TEST_DIR unexpectedly + NEW_TMPDIR=$(mktemp -d) + COREPACK_INSTALL_DIR="${NEW_TMPDIR}/corepack" mkdir -p "${COREPACK_INSTALL_DIR}" export PATH=${COREPACK_INSTALL_DIR}:$PATH fi diff --git a/turborepo-tests/integration/package.json b/turborepo-tests/integration/package.json index 0ab6e4fad6cb6..105be236af2cd 100644 --- a/turborepo-tests/integration/package.json +++ b/turborepo-tests/integration/package.json @@ -4,7 +4,7 @@ "test": "prysk tests", "clean": "rm -rf tests/**/*.t.err", "test:interactive": "PRYSK_INTERACTIVE=true prysk tests", - "test:parallel": ".cram_env/bin/pytest -n auto tests --prysk-shell=`which bash`", + "test:parallel": ".cram_env/bin/pytest --prysk-shell='bash'", "pretest:parallel": ".cram_env/bin/pip3 install --quiet pytest \"prysk[pytest-plugin]\" pytest-xdist" }, "dependencies": { diff --git a/turborepo-tests/integration/pytest.ini b/turborepo-tests/integration/pytest.ini new file mode 100644 index 0000000000000..88ff15eaac703 --- /dev/null +++ b/turborepo-tests/integration/pytest.ini @@ -0,0 +1,6 @@ +[pytest] +addopts = -n auto +required_plugins = pytest-xdist prysk +testpaths = + tests +tmp_path_retention_count = 1 diff --git a/turborepo-tests/integration/tests/find-turbo/hard-mode.t b/turborepo-tests/integration/tests/find-turbo/hard-mode.t index e9a041a9b52eb..b9537cff90e96 100644 --- a/turborepo-tests/integration/tests/find-turbo/hard-mode.t +++ b/turborepo-tests/integration/tests/find-turbo/hard-mode.t @@ -15,7 +15,7 @@ It finds repo root and uses correct version $ cd $TESTROOT/subdir/node_modules $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.8.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]hard-mode.t[\/\\]subdir[\/\\]node_modules[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]subdir[\/\\]node_modules[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 --skip-infer build --filter foo -vv --single-package -- @@ -24,7 +24,7 @@ It respects cwd $ cd $TESTROOT $ ${TURBO} build --filter foo -vv --cwd ${TESTROOT}/subdir > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.8.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]hard-mode.t[\/\\]subdir[\/\\]node_modules[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]subdir[\/\\]node_modules[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 --skip-infer build --filter foo -vv --single-package -- @@ -33,6 +33,6 @@ It respects cwd and finds repo root $ cd $TESTROOT $ ${TURBO} build --filter foo -vv --cwd ${TESTROOT}/subdir/node_modules > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.8.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]hard-mode.t[\/\\]subdir[\/\\]node_modules[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]subdir[\/\\]node_modules[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 --skip-infer build --filter foo -vv --single-package -- diff --git a/turborepo-tests/integration/tests/find-turbo/unplugged-env-moved.t b/turborepo-tests/integration/tests/find-turbo/unplugged-env-moved.t index 0425963d39ff4..08becf5aade09 100644 --- a/turborepo-tests/integration/tests/find-turbo/unplugged-env-moved.t +++ b/turborepo-tests/integration/tests/find-turbo/unplugged-env-moved.t @@ -7,7 +7,7 @@ Make sure we use local and do not pass --skip-infer to old binary $ set -o allexport; source .env; set +o allexport; $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.0.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]unplugged-env-moved\.t[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 build --filter foo -vv -- @@ -16,6 +16,6 @@ Make sure we use local and pass --skip-infer to newer binary $ set -o allexport; source .env; set +o allexport; $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.8.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]unplugged-env-moved\.t[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 --skip-infer build --filter foo -vv --single-package -- diff --git a/turborepo-tests/integration/tests/find-turbo/unplugged-moved.t b/turborepo-tests/integration/tests/find-turbo/unplugged-moved.t index 12262e16cf552..1b30797d1cf33 100644 --- a/turborepo-tests/integration/tests/find-turbo/unplugged-moved.t +++ b/turborepo-tests/integration/tests/find-turbo/unplugged-moved.t @@ -6,7 +6,7 @@ Make sure we use local and do not pass --skip-infer to old binary $ ${TESTDIR}/set_version.sh $(pwd) "1.0.0" $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.0.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]unplugged-moved\.t[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 build --filter foo -vv -- @@ -14,6 +14,6 @@ Make sure we use local and pass --skip-infer to newer binary $ ${TESTDIR}/set_version.sh $(pwd) "1.8.0" $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.8.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]unplugged-moved\.t[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]\.moved[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo(\.exe)?" out.log $ cat out.log | tail -n1 --skip-infer build --filter foo -vv --single-package -- diff --git a/turborepo-tests/integration/tests/find-turbo/unplugged.t b/turborepo-tests/integration/tests/find-turbo/unplugged.t index a6041e669b791..30c6c3f340bbc 100644 --- a/turborepo-tests/integration/tests/find-turbo/unplugged.t +++ b/turborepo-tests/integration/tests/find-turbo/unplugged.t @@ -6,7 +6,7 @@ Make sure we use local and do not pass --skip-infer to old binary $ ${TESTDIR}/set_version.sh $(pwd) "1.0.0" $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.0.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]unplugged\.t[\/\\]\.yarn[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]\.yarn[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo" out.log $ cat out.log | tail -n1 build --filter foo -vv -- @@ -14,6 +14,6 @@ Make sure we use local and pass --skip-infer to newer binary $ ${TESTDIR}/set_version.sh $(pwd) "1.8.0" $ ${TURBO} build --filter foo -vv > out.log 2>&1 $ grep --quiet -F "Local turbo version: 1.8.0" out.log - $ grep --quiet -E "Running local turbo binary in .*[\/\\]unplugged\.t[\/\\]\.yarn[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo" out.log + $ grep --quiet -E "Running local turbo binary in .*[\/\\]\.yarn[\/\\]unplugged[\/\\].*[\/\\]bin[\/\\]turbo" out.log $ cat out.log | tail -n1 --skip-infer build --filter foo -vv --single-package --