From 6e2da7c166a9f990366582ea8b668cf9e6ce5831 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 22 Jan 2026 11:08:11 +0000 Subject: [PATCH] change unit tests to run on every pr --- .github/workflows/unit_tests.yml | 11 ++--------- backend/engine/engine.py | 4 +--- recommendations/HeatingRecommender.py | 3 +-- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index 5428fe89..0e9c48fd 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -1,9 +1,9 @@ name: Run unit tests on: - push: + pull_request: branches: - - main + - * jobs: test: @@ -22,13 +22,6 @@ jobs: run: | make setup - - name: Set dev AWS credentials - uses: aws-actions/configure-aws-credentials@v1 - with: - aws-access-key-id: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} - aws-region: eu-west-2 - - name: Run tests with tox via Makefile env: EPC_AUTH_TOKEN: ${{ secrets.DEV_EPC_AUTH_TOKEN }} diff --git a/backend/engine/engine.py b/backend/engine/engine.py index 50ed0772..a9156078 100644 --- a/backend/engine/engine.py +++ b/backend/engine/engine.py @@ -885,13 +885,11 @@ async def model_engine(body: PlanTriggerRequest): ) # The materials data could be cached or local so we don't need to make - # consistent requests to the backend for - # the same data + # consistent requests to the backend for the same data logger.info("Reading in materials and cleaned datasets") with db_read_session() as session: materials = db_funcs.materials_functions.get_materials(session) cleaned = get_cleaned() - # project_scores_matrix, partial_project_scores_matrix, whlg_eligible_postcodes = get_funding_data() kwh_client = KwhData(bucket=get_settings().DATA_BUCKET, read_consumption_data=True) diff --git a/recommendations/HeatingRecommender.py b/recommendations/HeatingRecommender.py index ea3056ba..20568360 100644 --- a/recommendations/HeatingRecommender.py +++ b/recommendations/HeatingRecommender.py @@ -1265,8 +1265,7 @@ class HeatingRecommender: # We check if there's a mains connection and the hot water is inefficient, as this will improve with a boiler has_inefficient_water = ( - self.property.data["mains-gas-flag"] and - self.property.data["hot-water-energy-eff"] in ["Very Poor", "Poor"] + self.property.data["mains-gas-flag"] and self.property.data["hot-water-energy-eff"] in ["Very Poor", "Poor"] ) non_invasive_recommendation = next((