Skip to content

Commit

Permalink
chore(prysk): switch to pytest in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-olszewski committed Dec 10, 2024
1 parent b00654d commit 1031e0e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/turborepo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
key: prysk-venv-${{ matrix.os.runner }}

- name: Integration Tests
run: turbo run test --filter=turborepo-tests-integration --color --env-mode=strict --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }}
run: turbo run test:parallel --filter=turborepo-tests-integration --color --env-mode=strict --token=${{ secrets.TURBO_TOKEN }} --team=${{ vars.TURBO_TEAM }}

examples:
name: Turborepo Examples
Expand Down
14 changes: 9 additions & 5 deletions packages/prysk/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ execSync(`python3 -m venv ${VENV_NAME}`);
execSync(`${getVenvBin("python3")} -m pip install --quiet --upgrade pip`);

// Install prysk
execSync(`${getVenvBin("pip")} install "prysk==0.15.2"`);
execSync(
`${getVenvBin(
"pip"
)} install "pytest==8.3.3" "prysk[pytest-plugin]==0.3.0" "pytest-xdist==3.6.1"`
);

// Which tests do we want to run?
const testArg = process.argv[3] ? process.argv[3] : process.argv[2];
Expand All @@ -29,12 +33,12 @@ if (!tests) {
}

const flags = [
"--shell=bash",
"--pytest-shell=bash",
process.env.PRYSK_INTERACTIVE === "true" ? "--interactive" : "",
isWindows ? "--dos2unix" : "",
isWindows ? "--pytest-dos2unix" : "",
].join(" ");

const cmd = [getVenvBin("prysk"), flags, tests].join(" ");
const cmd = [getVenvBin("pytest"), flags, tests].join(" ");
console.log(`Running ${cmd}`);

try {
Expand All @@ -47,7 +51,7 @@ try {
}

function getVenvBin(tool) {
const allowedVenvTools = ["python3", "pip", "prysk"];
const allowedVenvTools = ["python3", "pip", "pytest"];
if (!allowedVenvTools.includes(tool)) {
throw new Error(`Tool not allowed: ${tool}`);
}
Expand Down
3 changes: 1 addition & 2 deletions turborepo-tests/integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"test": "prysk tests",
"clean": "rm -rf tests/**/*.t.err",
"test:interactive": "PRYSK_INTERACTIVE=true prysk tests",
"test:parallel": ".cram_env/bin/pytest --prysk-shell='bash'",
"pretest:parallel": ".cram_env/bin/pip3 install --quiet pytest \"prysk[pytest-plugin]\" pytest-xdist"
"test:parallel": "prysk --prysk-shell='bash'"
},
"dependencies": {
"turborepo-tests-helpers": "workspace:*",
Expand Down
4 changes: 4 additions & 0 deletions turborepo-tests/integration/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"test": {
"dependsOn": ["cli#build", "topo", "^build"],
"passThroughEnv": ["CI"]
},
"test:parallel": {
"dependsOn": ["cli#build", "topo", "^build"],
"passThroughEnv": ["CI"]
}
}
}

0 comments on commit 1031e0e

Please sign in to comment.