Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/e2e-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ jobs:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}

- name: Run single building simulation test
run: make cli tests single-building
env:
AWS_ENV: local.host
HATCHET_ENV: local.host

- name: Run E2E experiment
id: e2e
run: |
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ services:
volumes:
- ./inputs:/code/inputs
- ./outputs:/code/outputs
- ./tests/data/e2e:/code/tests/data/e2e
fanouts:
image: ${AWS_ACCOUNT_ID:-123456789012}.dkr.ecr.${AWS_REGION:-us-east-1}.amazonaws.com/hatchet/globi:${IMAGE_TAG:-latest}
build:
Expand Down
30 changes: 30 additions & 0 deletions src/globi/tools/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,36 @@ def tests():
pass


@tests.command()
@click.option(
"--config",
type=click.Path(exists=True),
default="tests/data/e2e/single-building.yml",
help="Path to the single building config YAML file.",
)
@click.option(
"--output-dir",
type=click.Path(file_okay=False),
default="outputs/single-building-test",
help="Output directory for simulation results.",
)
@click.pass_context
def single_building(
ctx: click.Context,
config: str = "tests/data/e2e/single-building.yml",
output_dir: str = "outputs/single-building-test",
):
"""Run single building simulation test.

Intended for CI; run with: make cli-native tests single-building
"""
import sys

ctx.invoke(simulate, config=Path(config), output_dir=Path(output_dir))
print("Single building simulation test passed.")
sys.exit(0)


@tests.command()
@click.option(
"--manifest",
Expand Down
20 changes: 20 additions & 0 deletions tests/data/e2e/single-building.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Single building simulation config for CLI/CI testing.
# Uses test data from tests/data/e2e/ - run from repo root.
db_file: tests/data/e2e/components-lib.db
semantic_fields_file: tests/data/e2e/semantic-fields.yml
component_map_file: tests/data/e2e/component-map.yml
epwzip_file: "https://climate.onebuilding.org/WMO_Region_4_North_and_Central_America/USA_United_States_of_America/MA_Massachusetts/USA_MA_Boston-Logan.Intl.AP.725090_TMYx.2009-2023.zip"
semantic_field_context:
Region: TestRegion
Typology: Residential
Age_bracket: Post_2000
Scenario: Baseline
Income: Low
length: 20.0
width: 15.0
num_floors: 2
f2f_height: 3.5
wwr: 0.3
basement: none
attic: none
exposed_basement_frac: 0.25
Loading