Skip to content

Developing and testing locally

cjshawMIT edited this page Jul 7, 2017 · 3 revisions

Installing Dependencies

Once you have your local environment set up (using either Docker containers or virtualenv is recommended), you need to install the project requirements:

pip install -r requirements.txt

Running unplatform

Running unplatform locally by default uses port 8888. You can run it with:

python main.py

However, if you have not built the ui, all you will see at https://localhost:8888 is a blank screen. To solve that, build the UI files, first.

Building the UI files

Because we don't know of a "hot reload" module for web.py that interfaces with node.js, you have to first compile / build the UI files with npm or yarn. Follow the instructions below.

yarn compile:ui

Every time you change a client-side file, you will need to run this command.

Server-side code

Server-side tests are located in the tests/ directory, and can be run with pytest once you have installed the test dependencies:

pip install -r test_requirements.txt
pytest

To run only a subset or a specific test, you can do things like:

pytest tests/test_main.py
pytest tests/test_main.py::BasicServiceTests
pytest tests/test_main.py::BasicServiceTests::test_users_can_get_index_page

You can also include the -x flag to stop the tests on the first failure.

pytest -x

Client-side code

Unfortunately we have no client-side tests, currently, and things need to be manually tested.

Versioning

We try to follow semver when updating unplatform. Please make sure you update the version value in package.json, as well as make a tag and update CHANGENOTES.md when releasing a new version.