Skip to content

Running Tests

Nicholas Long edited this page Aug 5, 2022 · 5 revisions

Running tests locally

There are three stages of tests: unit tests, docker-based simulation tests, and integration tests. To run the tests, first run the following commands, then jump to the section of interest below.

  1. Install Docker Desktop for your platform
  2. Install Poetry: pip install poetry
  3. Install dependencies: poetry install

Unit Tests

  1. Run unit tests: poetry run pytest

Docker-based Simulation Tests

  1. Run docker dev stack locally (in detached mode)

    docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build -d
  2. Call Modelica tests

    docker exec alfalfa_worker bash -c "cd /alfalfa && pytest -m docker tests/jobs/modelica"
  3. Call OpenStudio tests:

    docker exec alfalfa_worker bash -c "cd /alfalfa && pytest -m docker tests/jobs/openstudio"
  4. Clean up stack: docker-compose down

Integration Tests

  1. Run stack locally in detached mode: docker-compose up --build -d
  2. Run integration tests: poetry run pytest -m "integration"
  3. Clean up stack: docker-compose down

Model Configuration

Openstudio

Tutorials

Guides

Reference

Modelica

Guides

Alfalfa Interaction

Tutorials

Guides

Reference

Explanation

Alfalfa Development

Guides

General

Reference

Explanation

Clone this wiki locally