diff --git a/.github/workflows/e2e-integration.yml b/.github/workflows/e2e-integration.yml index a61c8da..f3e3cd6 100644 --- a/.github/workflows/e2e-integration.yml +++ b/.github/workflows/e2e-integration.yml @@ -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: | diff --git a/docker-compose.yml b/docker-compose.yml index 497b8a1..c5a1d8a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/src/globi/tools/cli/main.py b/src/globi/tools/cli/main.py index f055c68..e36e447 100644 --- a/src/globi/tools/cli/main.py +++ b/src/globi/tools/cli/main.py @@ -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", diff --git a/tests/data/e2e/single-building.yml b/tests/data/e2e/single-building.yml new file mode 100644 index 0000000..2e0e819 --- /dev/null +++ b/tests/data/e2e/single-building.yml @@ -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