Development Environment Setup with VSCode¶
The instructions below are for setting up an stb-tester development environment on your Windows PC, but it’s the same process on MacOS or Linux.
Download the Python 3.6.8 Windows installer from: https://www.python.org/downloads/release/python-368/ . You’ll want the “Windows x86-64 executable installer”. Run it to install.
You can install Python 3.6 alongside any other Python installations you have, they shouldnt interfere with each other.
Go to https://git-scm.com and download the installer for the latest release.
Run the installer to install git.
Download the installer from https://code.visualstudio.com .
Run the installer to install VSCode
Restart VSCode - otherwise sometimes PATH isn’t set correctly and the
installed above is not available in the terminal.
Within VSCode click “clone repository” and copy and paste your test-pack repo url from your portal. For example: https://github.com/stb-tester/stb-tester-test-pack-example . You should see a “Connect to GitHub” dialog box appear, which will launch a blank webpage in your browser. Your test-pack will then be cloned to your local machine.
At the “Would you like to open the cloned repository?” dialog select “Open”
Configure VSCode and your venv for stb-tester development¶
Start a “git bash” terminal and run:
py stbt_rig.py setup --vscode
This will create a Python venv, install dev dependencies and update your VSCode settings to enable linting, running tests and snapshots.
Test that it’s all working¶
- Try running a test from within VSCode - we should see it running in the portal.
- We should see stbt-specific linting in place, so lets introduce an error deliberately.
- git snapshot on save should be working, so we can see it in action with the Object Repository.