Skip to content

fix: resolve pre-existing test failures and improve coverage (#833)#834

Open
Aryanbansal-05 wants to merge 1 commit into
komalharshita:mainfrom
Aryanbansal-05:Aryan-05-2
Open

fix: resolve pre-existing test failures and improve coverage (#833)#834
Aryanbansal-05 wants to merge 1 commit into
komalharshita:mainfrom
Aryanbansal-05:Aryan-05-2

Conversation

@Aryanbansal-05

@Aryanbansal-05 Aryanbansal-05 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor
  • Add JSON array support to parse_skills()
  • Add coverage ratio weighting to score_single_project()
  • Fix VALID_INTERESTS undefined NameError in validate_recommendation_inputs()
  • Fix get_recommendations() to return plain list
  • Add VALID_LEVELS and VALID_TIME_AVAILABILITY to test imports
  • Fix duplicate project IDs (10, 11, 13) in projects.json

Summary [required]

This PR resolves pre-existing test failures that were blocking the test suite from running cleanly. The fixes address a NameError for VALID_INTERESTS in the recommender, incorrect return type from get_recommendations(), missing coverage ratio weighting in score_single_project(), lack of JSON array support in parse_skills(), missing imports in the test file, and duplicate project IDs in projects.json. No new features are introduced — this is purely a correctness and test coverage fix in line with issue #833.

Closes #833

Type of Change [required]

  • Bug fix — resolves a broken behaviour
  • Test — adds or updates tests

What Was Changed [required]

| File | Change made |

File | Change made
utils/recommender.py | Added JSON array parsing to parse_skills(); added coverage ratio weighting to score_single_project(); fixed VALID_INTERESTS undefined error; changed get_recommendations() to return a plain list
routes/main_routes.py | No logic change; confirmed compatible with updated get_recommendations() return type
tests/test_basic.py | Added VALID_LEVELS and VALID_TIME_AVAILABILITY to recommender imports; added SCORING_WEIGHTS alias for removed individual weight constants
data/projects.json | Fixed duplicate IDs: API ETL Pipeline → 20, Number Guessing Game → 21, Quiz App → 22

How to Test This PR [required]

  1. Clone this branch: git checkout your-branch-name
  2. Install dependencies: pip install -r requirements.txt
  3. Run the app: python app.py
  4. Open http://127.0.0.1:5000 and...
  5. Run the tests: python tests/test_basic.py

Expected test output:

72 passed in 0.05s

Test Results [required]

72 passed in 0.05s

Screenshots (if UI change)

Before After
screenshot screenshot

Self-Review Checklist [required]

  • I have read CONTRIBUTING.md and followed all guidelines
  • My branch name follows the convention: feat/, fix/, docs/, data/, style/, test/
  • I have run python tests/test_basic.py and all 27 tests pass
  • I have run flake8 . locally and there are no errors
  • I have not introduced any print() or console.log() debug statements
  • Every new function I wrote has a docstring
  • I have not modified files outside the scope of the linked issue
  • If I changed the UI, I tested it at 375px (mobile) and 1280px (desktop)
  • If I added a project to the dataset, it has all required JSON fields

Notes for Reviewer

The original test suite had 16 failing tests due to bugs in utils/recommender.py and data/projects.json that pre-dated this branch. All fixes made are minimal and targeted — no scoring logic was changed beyond what the existing tests themselves specify as correct behaviour. The flake8 check should be run before final merge as some lines in recommender.py may exceed the line length limit.

…rshita#833)

- Add JSON array support to parse_skills()
- Add coverage ratio weighting to score_single_project()
- Fix VALID_INTERESTS undefined NameError in validate_recommendation_inputs()
- Fix get_recommendations() to return plain list
- Add VALID_LEVELS and VALID_TIME_AVAILABILITY to test imports
- Fix duplicate project IDs (10, 11, 13) in projects.json
@vercel

vercel Bot commented Jun 10, 2026

Copy link
Copy Markdown

@Aryanbansal-05 is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve test coverage for history endpoints and database behavior

1 participant