Skip to content

Commit

Permalink
Merge branch 'master' into issue424_v030
Browse files Browse the repository at this point in the history
  • Loading branch information
dhblum committed Jul 27, 2022
2 parents a7a8db0 + 5c56c79 commit 10670a5
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 86 deletions.
41 changes: 40 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,46 @@ jobs:
include:
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make test_all
script: cd testing && make build_jm_image && make test_parser
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_data
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_forecast
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_kpis
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_readme_commands
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_testcase1
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_testcase2
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_testcase3
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_bestest_air
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_bestest_hydronic
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_bestest_hydronic_heat_pump
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_multizone_residential_hydronic
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_singlezone_commercial_hydronic
- python: 3.9
install: pip install --upgrade pip && pip install pandas==1.2.5 numpy==1.20.2 matplotlib==3.3.4 requests==2.25.1
script: cd testing && make build_jm_image && make test_multizone_office_simple_air
- python: 2.7
install: pip install --upgrade pip && pip install pandas==0.24.2 numpy==1.16.6 matplotlib==2.1.1 requests==2.18.4
script: cd testing && make test_python2
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,15 @@ Visit the [BOPTEST Home Page](https://ibpsa.github.io/project1-boptest/) for mor
## Quick-Start to Deploy a Test Case
1) Download this repository.
2) Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
3) Build and deploy a test case using the following commands executed in the root directory of this repository and where <testcase_dir_name> is the name of the test case subdirectory located in [/testcases](https://github.com/ibpsa/project1-boptest/tree/master/testcases):
3) To build and deploy a test case, use the following commands within the root directory of the extracted software:

* Linux or macOS: ``$ TESTCASE=<testcase_dir_name> docker-compose up``
* Windows PowerShell: ``> ($env:TESTCASE="<testcase_directory>") -and (docker-compose up)``
* Linux or macOS: ``$ TESTCASE=<testcase_name> docker-compose up``
* Windows PowerShell: ``> ($env:TESTCASE="<testcase_name>") -and (docker-compose up)``
* A couple notes:
* The first time this command is run, the image ``boptest_base`` will be built. This takes about a minute. Subsequent usage will use the already-built image and deploy much faster.
* Replace ``<testcase_name>`` with the name of the test case you wish to deploy. Test case names can be found in the ["testcases" directory](https://github.com/ibpsa/project1-boptest/tree/master/testcases) or on the ["Test Cases" web page](https://ibpsa.github.io/project1-boptest/testcases/index.html).
* The first time this command is run, the image ``boptest_base`` will be built. This takes about a minute. Subsequent usage will use the already-built image and deploy much faster.
* If you update your BOPTEST repository, use the command ``docker rmi boptest_base`` to remove the image so it can be re-built with the updated repository upon next deployment.
* ``TESTCASE`` is simply an environment variable. Consistent with use of docker-compose, you may also edit the value of this variable in the ``.env`` file and then use ``docker-compose up``.
* ``TESTCASE`` is simply an environment variable. Consistent with use of docker-compose, you may also edit the value of this variable in the ``.env`` file and then use ``docker-compose up``.

4) In a separate process, use the test case API defined below to interact with the test case using your test controller. Alternatively, view and run an example test controller as described below.
5) Shutdown the test case by the command ``docker-compose down`` executed in the root directory of this repository
Expand Down
1 change: 1 addition & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Thank you to all who have provided guidance on the development of this software.

- Javier Arroyo, KU Leuven
- Kyle Benne, National Renewable Energy Laboratory
- Dave Biagioni, National Renewable Energy Laboratory
- David Blum, Lawrence Berkeley National Laboratory
- Yan Chen, Pacific Northwest National Laboratory
- Konstantin Filonenko, University of Southern Denmark
Expand Down
2 changes: 2 additions & 0 deletions releasenotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Released on 07/27/2022.

**The following changes are backwards-compatible and do not significantly change benchmark results:**

- Clarify ``README.md`` instructions for the deployment of a test case. This for [#451](https://github.com/ibpsa/project1-boptest/issues/451).
- Split unit tests into parallel jobs on travis. This is for [#450](https://github.com/ibpsa/project1-boptest/issues/450).
- Add simulation support for test case FMUs compiled using Spawn of EnergyPlus. Does not address workflows for the compiling process for test case FMUs using Spawn. This is for [#406](https://github.com/ibpsa/project1-boptest/issues/406).
- New project home page launched at [https://ibpsa.github.io/project1-boptest/](https://ibpsa.github.io/project1-boptest/). This is for [#214](https://github.com/ibpsa/project1-boptest/issues/214).
- Add file exclusion list to ``data_manager.py`` when loading data from fmu resource directory. This is for [#423](https://github.com/ibpsa/project1-boptest/issues/423).
Expand Down
2 changes: 1 addition & 1 deletion testcases/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This directory contains test cases for BOPTEST. A summary of available test cases is provided in the table below. For more detail on a particular test case, go to ``/<testcase_dir_name>/docs``.

| Test Case | Description | Scenarios |
| Test Case Name | Description | Scenarios |
|------------------------------------------------------------|-----------------------------------------------|--------------------|
| ``testcase1`` | Prototype test case for development purposes. Single-zone R1C1 room model with sinusoidal ambient temperature and heater. |**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**:<br />``'test_day'``|
| ``testcase2``| Prototype test case for development purposes. Based on the single-zone AHU model found in Modelica Buildings Library. |**Electricity Prices**: <br />``'constant'``, <br />``'dynamic'``, <br />``'highly_dynamic'``<br />**Time Periods**:<br />``'test_day'``|
Expand Down
93 changes: 14 additions & 79 deletions testing/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ generate_testcase_data:

# Tests
###############################################################################

# Generic test for all testcases except testcase1 and testcase2
test_%:
# Compile testcase model
make compile_testcase_model TESTCASE=$*
# Build and deploy testcase image
cd .. && TESTCASE=$* docker-compose up -d
python sleep10.py
# Run testcase tests
cd .. && python testing/test_$*.py
# Stop testcase container
cd .. && docker-compose down

test_testcase1:
# Compile testcase model
make compile_testcase_model TESTCASE=testcase1
Expand Down Expand Up @@ -113,84 +126,6 @@ test_testcase2:
cd ../examples/javascript && make remove-image Script=testcase2
cd ../examples/javascript && rm geckodriver

test_bestest_air:
# Compile testcase model
make compile_testcase_model TESTCASE=bestest_air
# Build and deploy testcase image
cd .. && TESTCASE=bestest_air docker-compose up -d
python sleep10.py
# Run testcase tests
cd .. && python testing/test_bestest_air.py
# Stop testcase container
cd .. && TESTCASE=bestest_air docker-compose down

test_testcase3:
# Compile testcase model
make compile_testcase_model TESTCASE=testcase3
# Build and deploy testcase image
cd .. && TESTCASE=testcase3 docker-compose up -d
python sleep10.py
# Run testcase tests
# Python and checks
cd .. && python testing/test_testcase3.py
# Stop testcase container
cd .. && TESTCASE=testcase3 docker-compose down

test_bestest_hydronic:
# Compile testcase model
make compile_testcase_model TESTCASE=bestest_hydronic
# Build and deploy testcase image
cd .. && TESTCASE=bestest_hydronic docker-compose up -d
python sleep10.py
# Run testcase tests
cd .. && python testing/test_bestest_hydronic.py
# Stop testcase container
cd .. && TESTCASE=bestest_hydronic docker-compose down

test_bestest_hydronic_heat_pump:
# Compile testcase model
make compile_testcase_model TESTCASE=bestest_hydronic_heat_pump
# Build and deploy testcase image
cd .. && TESTCASE=bestest_hydronic_heat_pump docker-compose up -d
python sleep10.py
# Run testcase tests
cd .. && python testing/test_bestest_hydronic_heat_pump.py
# Stop testcase container
cd .. && TESTCASE=bestest_hydronic_heat_pump docker-compose down

test_multizone_residential_hydronic:
# Compile testcase model
make compile_testcase_model TESTCASE=multizone_residential_hydronic
# Build and deploy testcase image
cd .. && TESTCASE=multizone_residential_hydronic docker-compose up -d
python sleep10.py && python sleep10.py
# Run testcase tests
cd .. && python testing/test_multizone_residential_hydronic.py
# Stop testcase container
cd .. && TESTCASE=multizone_residential_hydronic docker-compose down

test_singlezone_commercial_hydronic:
# Compile testcase model
make compile_testcase_model TESTCASE=singlezone_commercial_hydronic
# Build and deploy testcase image
cd .. && TESTCASE=singlezone_commercial_hydronic docker-compose up -d
python sleep10.py && python sleep10.py
# Run testcase tests
cd .. && python testing/test_singlezone_commercial_hydronic.py
# Stop testcase container
cd .. && TESTCASE=singlezone_commercial_hydronic docker-compose down

test_multizone_office_simple_air:
# Compile testcase model
make compile_testcase_model TESTCASE=multizone_office_simple_air
# Build and deploy testcase image
cd .. && TESTCASE=multizone_office_simple_air docker-compose up -d
python sleep10.py && python sleep10.py
# Run testcase tests
cd .. && python testing/test_multizone_office_simple_air.py
# Stop testcase container
cd .. && TESTCASE=multizone_office_simple_air docker-compose down

test_parser:
make run_jm
make copy_to_jm ARGS=parsing
Expand Down Expand Up @@ -316,4 +251,4 @@ test_all:
# Remove boptest base image
make remove_boptest_image
# Report test results
python report.py
python report.py

0 comments on commit 10670a5

Please sign in to comment.