Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(prysk) make tests run in parallel #9381

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
4 changes: 3 additions & 1 deletion turborepo-tests/helpers/setup_package_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion turborepo-tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 6 additions & 0 deletions turborepo-tests/integration/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[pytest]
addopts = -n auto
required_plugins = pytest-xdist prysk
testpaths =
tests
tmp_path_retention_count = 1
6 changes: 3 additions & 3 deletions turborepo-tests/integration/tests/find-turbo/hard-mode.t
Original file line number Diff line number Diff line change
Expand Up @@ -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 --

Expand All @@ -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 --

Expand All @@ -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 --
Original file line number Diff line number Diff line change
Expand Up @@ -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 --

Expand All @@ -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 --
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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 --

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 --
4 changes: 2 additions & 2 deletions turborepo-tests/integration/tests/find-turbo/unplugged.t
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ 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 --

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 --
Loading