Skip to content

Conversation

@NishaSharma14
Copy link
Contributor

No description provided.

@NishaSharma14 NishaSharma14 linked an issue Dec 9, 2025 that may be closed by this pull request
@NishaSharma14 NishaSharma14 self-assigned this Dec 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive API endpoint tests across multiple controllers, improving test coverage for authentication, data access, search, file system operations, and ELN integration. The changes also include necessary test infrastructure updates like disabling API throttling in the testing environment and updating factories for better test data generation.

Key Changes

  • Added 10 new test files covering API endpoints for user authentication, data retrieval, search, and ELN workflows
  • Disabled API throttling in the testing environment to allow full test suite execution
  • Updated factory defaults for better test data consistency (Molecule identifier, FileSystemObject type)
  • Commented out an unprotected DOI update route with security concerns

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 22 comments.

Show a summary per file
File Description
tests/API/UserControllerTest.php Tests for authenticated user info endpoint with various scenarios
tests/API/SearchControllerTest.php Comprehensive search endpoint tests covering multiple query types and validation
tests/API/RegisterControllerTest.php User registration tests with validation checks (has HTTP status code issues)
tests/API/LoginControllerTest.php Login/logout functionality tests (has HTTP status code issues)
tests/API/FileSystemControllerTest.php File system object retrieval tests (contains performance issue with sleep)
tests/API/ELNControllerTest.php ELN upload and status tests with complex workflows (has hardcoded year issue)
tests/API/DataControllerTest.php Public data listing, filtering, sorting, and retrieval tests
tests/API/DataCiteControllerTest.php DataCite schema endpoint tests
tests/API/DataCatalogControllerTest.php DataCatalog/Bioschemas endpoint tests
tests/API/BioschemasControllerTest.php Bioschemas endpoint access control tests
routes/api.php Commented out DOI update route due to security concerns (has typo)
database/factories/MoleculeFactory.php Added unique identifier generation for test molecules
database/factories/FileSystemObjectFactory.php Clarified 'directory' type usage in comment
bootstrap/app.php Disabled API throttling during testing to allow test execution

@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 63.10%. Comparing base (6637646) to head (9bb30d1).

Files with missing lines Patch % Lines
...tp/Controllers/API/Auth/VerificationController.php 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                Coverage Diff                @@
##             development    #1313      +/-   ##
=================================================
+ Coverage          56.63%   63.10%   +6.46%     
- Complexity          2268     2269       +1     
=================================================
  Files                207      207              
  Lines               8733     8738       +5     
=================================================
+ Hits                4946     5514     +568     
+ Misses              3787     3224     -563     
Flag Coverage Δ
unittests 63.10% <85.71%> (+6.46%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@NishaSharma14
Copy link
Contributor Author

@vcnainala The update method of DOIController is not being used anywhere. The artisan command - nmrxiv:update-projects-dois make the direct model method calls: $model->updateDOIMetadata().

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.

Add tests cases for APIs.

2 participants