From af9087aa5d116ec596a313b3e3e7ef7aef9e1b3a Mon Sep 17 00:00:00 2001 From: Chijie An Date: Fri, 20 Feb 2026 11:40:04 -0500 Subject: [PATCH 1/6] D1: raise coverage gate to 70 and show failing run --- .github/workflows/ci.yml | 2 +- tests/test_prediction_pipeline_demo.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a386933..65b81cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: env: PYTHONPATH: ${{ github.workspace }} run: | - python -m pytest -q --cov=prediction_pipeline_demo --cov-report=term-missing --cov-fail-under=50 + python -m pytest -q --cov=prediction_pipeline_demo --cov-report=term-missing --cov-fail-under=70 # TODO: Add a step here to run the demo pipeline end-to-end # The goal is to execute prediction_pipeline_demo.py so CI logs show the model’s R^2 score. \ No newline at end of file diff --git a/tests/test_prediction_pipeline_demo.py b/tests/test_prediction_pipeline_demo.py index ada2b55..1017693 100644 --- a/tests/test_prediction_pipeline_demo.py +++ b/tests/test_prediction_pipeline_demo.py @@ -56,11 +56,12 @@ def feature_target_sample(housing_data_sample): def test_data_split_returns_four_parts(feature_target_sample): # TODO(1): Uncomment the line below to get the split - # parts = data_split(*feature_target_sample) + parts = data_split(*feature_target_sample) # TODO(2): Add assertions to check: # - parts is a tuple # - tuple has exactly 4 elements - pass + assert isinstance(parts, tuple) + assert len(parts) == 4 def test_end_to_end_train_and_eval(feature_target_sample): From d239b1d669df937b5c35017ac0d08fc529baf6db Mon Sep 17 00:00:00 2001 From: Chijie An Date: Fri, 20 Feb 2026 11:40:42 -0500 Subject: [PATCH 2/6] D1: restore tests to pass coverage gate --- tests/test_prediction_pipeline_demo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_prediction_pipeline_demo.py b/tests/test_prediction_pipeline_demo.py index 1017693..9f0757f 100644 --- a/tests/test_prediction_pipeline_demo.py +++ b/tests/test_prediction_pipeline_demo.py @@ -66,11 +66,12 @@ def test_data_split_returns_four_parts(feature_target_sample): def test_end_to_end_train_and_eval(feature_target_sample): # TODO(3): Uncomment these lines to train and evaluate the model - # X_train, X_test, y_train, y_test = data_split(*feature_target_sample) - # model = train_model(X_train, y_train) - # score = eval_model(X_test, y_test, model) + X_train, X_test, y_train, y_test = data_split(*feature_target_sample) + model = train_model(X_train, y_train) + score = eval_model(X_test, y_test, model) # TODO(4): Add assertions to check: # - score is a float # - score is finite (not NaN or inf) - pass + assert isinstance(score, float) + assert np.isfinite(score) From b5d8843160103e1b5a117d8cefbbac79f0ef2388 Mon Sep 17 00:00:00 2001 From: Chijie An Date: Fri, 20 Feb 2026 11:56:10 -0500 Subject: [PATCH 3/6] D1: trigger failing coverage run on PR --- tests/test_prediction_pipeline_demo.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_prediction_pipeline_demo.py b/tests/test_prediction_pipeline_demo.py index 9f0757f..1017693 100644 --- a/tests/test_prediction_pipeline_demo.py +++ b/tests/test_prediction_pipeline_demo.py @@ -66,12 +66,11 @@ def test_data_split_returns_four_parts(feature_target_sample): def test_end_to_end_train_and_eval(feature_target_sample): # TODO(3): Uncomment these lines to train and evaluate the model - X_train, X_test, y_train, y_test = data_split(*feature_target_sample) - model = train_model(X_train, y_train) - score = eval_model(X_test, y_test, model) + # X_train, X_test, y_train, y_test = data_split(*feature_target_sample) + # model = train_model(X_train, y_train) + # score = eval_model(X_test, y_test, model) # TODO(4): Add assertions to check: # - score is a float # - score is finite (not NaN or inf) - assert isinstance(score, float) - assert np.isfinite(score) + pass From b55a51d26b48f4d73d2ef53c6cf8db02189b3c04 Mon Sep 17 00:00:00 2001 From: Chijie An Date: Fri, 20 Feb 2026 11:56:46 -0500 Subject: [PATCH 4/6] D1: restore passing coverage run on PR --- tests/test_prediction_pipeline_demo.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/test_prediction_pipeline_demo.py b/tests/test_prediction_pipeline_demo.py index 1017693..9f0757f 100644 --- a/tests/test_prediction_pipeline_demo.py +++ b/tests/test_prediction_pipeline_demo.py @@ -66,11 +66,12 @@ def test_data_split_returns_four_parts(feature_target_sample): def test_end_to_end_train_and_eval(feature_target_sample): # TODO(3): Uncomment these lines to train and evaluate the model - # X_train, X_test, y_train, y_test = data_split(*feature_target_sample) - # model = train_model(X_train, y_train) - # score = eval_model(X_test, y_test, model) + X_train, X_test, y_train, y_test = data_split(*feature_target_sample) + model = train_model(X_train, y_train) + score = eval_model(X_test, y_test, model) # TODO(4): Add assertions to check: # - score is a float # - score is finite (not NaN or inf) - pass + assert isinstance(score, float) + assert np.isfinite(score) From 34a494e6adecbdab7f0898e65621ccb640c2aea4 Mon Sep 17 00:00:00 2001 From: Chijie An Date: Fri, 20 Feb 2026 12:11:45 -0500 Subject: [PATCH 5/6] D2: run CI on self-hosted runner and show Python --- .github/workflows/ci.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65b81cf..bc00b29 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,16 +8,14 @@ on: jobs: test: - runs-on: ubuntu-latest + runs-on: self-hosted steps: - name: Checkout uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" + - name: Show Python + run: python3 --version - name: Install dependencies run: | @@ -31,4 +29,4 @@ jobs: python -m pytest -q --cov=prediction_pipeline_demo --cov-report=term-missing --cov-fail-under=70 # TODO: Add a step here to run the demo pipeline end-to-end - # The goal is to execute prediction_pipeline_demo.py so CI logs show the model’s R^2 score. \ No newline at end of file + # The goal is to execute prediction_pipeline_demo.py so CI logs show the model’s R^2 score. From f2a35ea5352cd86c5e0b7e96e5c2749c57242c4f Mon Sep 17 00:00:00 2001 From: Chijie An Date: Fri, 20 Feb 2026 14:05:07 -0500 Subject: [PATCH 6/6] D3: run demo ML pipeline in CI --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc00b29..4230199 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,5 +28,6 @@ jobs: run: | python -m pytest -q --cov=prediction_pipeline_demo --cov-report=term-missing --cov-fail-under=70 - # TODO: Add a step here to run the demo pipeline end-to-end - # The goal is to execute prediction_pipeline_demo.py so CI logs show the model’s R^2 score. + - name: Run demo ML pipeline + run: | + python prediction_pipeline_demo.py