Skip to content

Add Missing Test Cases for Key API Endpoints and Backend Apps #4676

@RishabhJain2018

Description

@RishabhJain2018

Description:

This issue is to audit and improve test coverage for important API endpoints and backend modules that currently lack sufficient test cases. Ensuring robust coverage will enhance EvalAI's reliability, make future changes safer, and reduce the likelihood of regressions.

Checklist:

Please check whether tests exist for each of the following, and if not, add them:


API Endpoints

Auth & Accounts

  • POST /auth/register/
  • POST /auth/login/
  • GET /accounts/user/get_auth_token
  • GET /accounts/user/refresh_auth_token
  • POST /auth/password/change/
  • POST /accounts/user/resend_email_verification/

Challenges

  • PUT /challenges/{challengeId}/manage_worker/{action}/
  • GET /challenges/{challengeId}/request_approval
  • GET /challenges/{challengeId}/get_worker_logs/
  • GET /challenges/challenge/{challengeId}/prizes/
  • GET /challenges/challenge/{challengeId}/sponsors/
  • POST /challenges/{challengeId}/participate/
  • PUT /challenges/{challengeId}/scale_resources/
  • GET /challenges/challenge/{challengeId}/get_participant_teams
  • POST /challenges/challenge/{challengeId}/deregister/

Jobs

  • GET /jobs/phase_split/{phaseSplitId}/public_leaderboard_all_entries/
  • PATCH /jobs/challenges/{challengeId}/submissions/{submissionId}/update_submission_meta/

Backend Apps & Files

Models

  • apps/hosts/models.py
  • apps/jobs/models.py
  • apps/base/models.py
  • apps/participants/models.py
  • apps/accounts/models.py
  • apps/challenges/models.py

Serializers

  • apps/challenges/serializers.py
  • apps/participants/serializers.py
  • apps/accounts/serializers.py

Views & Admin

  • apps/web/views.py
  • apps/challenges/admin.py
  • apps/web/admin.py
  • apps/participants/admin.py
  • apps/jobs/admin.py
  • apps/hosts/admin.py

Utilities & Celery Tasks

  • apps/base/utils.py
  • apps/jobs/utils.py
  • apps/jobs/tasks.py
  • apps/jobs/sender.py
  • apps/challenges/utils.py
  • apps/hosts/utils.py
  • apps/challenges/aws_utils.py
  • evalai/celery.py

Expected Outcome:

  • Identify all components above that lack tests.
  • Add unit tests as appropriate.
  • Ensure that new tests follow existing conventions.
  • Verify increased coverage via pytest --cov or Codecov integration (once available).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions