Skip to content

Commit fdaa14a

Browse files
GeekTrainerCopilot
andcommitted
Use platform-aware Python executable in test server script
Detect platform to choose python3 (Unix) or py (Windows), with PYTHON env var override for custom setups. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent fa026fb commit fdaa14a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/client/start-test-server.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ const path = require('path');
44

55
const serverDir = path.resolve(__dirname, '..', 'server');
66
const testDbPath = path.join(serverDir, 'e2e_test_dogshelter.db');
7+
const python = process.env.PYTHON || (process.platform === 'win32' ? 'py' : 'python3');
78

89
// Seed the test database
9-
execSync('python3 utils/seed_test_database.py', {
10+
execSync(`${python} utils/seed_test_database.py`, {
1011
cwd: serverDir,
1112
stdio: 'inherit',
1213
});
1314

1415
// Start Flask with the test database
15-
const server = spawn('python3', ['app.py'], {
16+
const server = spawn(python, ['app.py'], {
1617
cwd: serverDir,
1718
env: { ...process.env, DATABASE_PATH: testDbPath },
1819
stdio: 'inherit',

0 commit comments

Comments
 (0)