Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.97 KB

File metadata and controls

62 lines (41 loc) · 1.97 KB

openhi-docker-dev

Ready-made Enhydris development environment

Prerequisites

  • On Windows: VirtualBox
  • Linux: Docker

Setting up

  1. Clone this repository: git clone [email protected]:openmeteo/openhi-docker-dev.

  2. Enter the working directory: cd openhi-docker-dev

  3. Clone the Enhydris repositories:

    git clone [email protected]:openmeteo/enhydris
    git clone [email protected]:openmeteo/enhydris-synoptic
    git clone [email protected]:openmeteo/enhydris-autoprocess
    git clone [email protected]:openmeteo/enhydris-openhigis
    
  4. Get a database dump file named dbdump.tar.gz and put it in the shared directory.

  5. ./build.sh will build the image.

  6. ./run.sh will create/start the container.

  7. Once in the container, dbimport will import the database.

  8. python manage.py migrate will ensure the database is up-to-date (the database import file could be slightly out of date).

  9. In the container, npm install will install npm packages needed for the tests. (NOTE: On Windows you have to enter sudo npm install instead, because of docker/for-win#2476.)

  10. In the container, runserver will start the server.

  11. In your browser, visit http://localhost:8001/.

Running the unit tests in a visible browser

First, make sure that the chrome_options and SELENIUM_WEBDRIVERS settings in enhydris/enhydris_project/settings/local.py are as they are in local.py (in the root directory of enhydris-docker-dev). (The top-level local.py is copied to enhydris/enhydris_project/settings/local.py when the container is built, unless the latter file already exists.)

By default, selenium tests are run headlessly. If you want to make them visible, then:

  1. In enhydris/enhydris_project/settings/local.py, comment out the line chrome_options.add_argument("--headless").
  2. Use a VNC client to connect to localhost:5901, using topsecret as the password.

Then, when you run the Selenium tests, they should be visible.