Skip to content

[FEATURE] Add versioned REST API endpoints for test results (v1)#1046

Draft
Rahul-2k4 wants to merge 3 commits intoCCExtractor:masterfrom
Rahul-2k4:feature/rest-api-v1-1045
Draft

[FEATURE] Add versioned REST API endpoints for test results (v1)#1046
Rahul-2k4 wants to merge 3 commits intoCCExtractor:masterfrom
Rahul-2k4:feature/rest-api-v1-1045

Conversation

@Rahul-2k4
Copy link

@Rahul-2k4 Rahul-2k4 commented Mar 5, 2026

Summary

Implements a new versioned REST API module for Sample Platform test result data and adds endpoint tests.

Added endpoints

  • GET /api/v1/tests/<id>/summary
  • GET /api/v1/tests/<id>/results
  • GET /api/v1/tests/<id>/files
  • GET /api/v1/tests/<id>/progress
  • GET /api/v1/categories

Implementation details

  • Added new Flask blueprint module: mod_api/.
  • Registered blueprint in run.py with url_prefix='/api'.
  • Added 404 handling for missing test ids.
  • Added API tests in tests/test_api/test_controllers.py.
  • Included contract fix so /results uses result-backed expected_rc when available.
  • Added not-found tests for /results, /files, and /progress.

Verification

Executed:

  • /home/rahul/Desktop/GSoC_2026/ccextractor/sample-platform/.venv/bin/nose2 -v tests.test_api.test_controllers

Result:

  • Ran 9 tests ... OK

Notes

  • This PR is focused on API availability and baseline contract coverage for NG frontend consumption.
  • Follow-up improvements can extend pagination/filtering/schema docs if maintainers prefer stricter contracts.

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

My familiarity with the project is as follows (check one):

  • I have never used the project.
  • I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • I am an active contributor to the project.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 5, 2026

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant