Skip to content

[Devportal] Fix failing integration tests#2718

Merged
lasanthaS merged 3 commits into
wso2:mainfrom
Piumal1999:fix-tests
Jul 17, 2026
Merged

[Devportal] Fix failing integration tests#2718
lasanthaS merged 3 commits into
wso2:mainfrom
Piumal1999:fix-tests

Conversation

@Piumal1999

Copy link
Copy Markdown
Contributor

Purpose

Fixing several failing tests

Approach

  • Fixed the failing rest-api tests
  • Updated the test configs and test framework, so that github action can correctly identify test failures

Samples

N/A

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Piumal1999, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 32 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 5cfd9e7b-a0be-4afd-a44b-423f86c8b4d1

📥 Commits

Reviewing files that changed from the base of the PR and between 4236856 and d5e1d11.

📒 Files selected for processing (2)
  • portals/developer-portal/it/docker-compose.test.postgres.yaml
  • portals/developer-portal/it/rest-api/support/cleanup.js
📝 Walkthrough

Walkthrough

The changes add pagination parameters to the labels API contract, preserve API handles during updates, correct API file deletion responses, add REST test resource cleanup, improve Docker test exit handling, update authentication scopes, and align integration tests with current request fields.

Changes

API contracts and metadata behavior

Layer / File(s) Summary
Label pagination contract
docs/rest-apis/devportal/labels.md, portals/developer-portal/docs/devportal-openapi-spec-v0.9.yaml
The List labels operation documents and declares limit and offset query parameters.
Metadata and file response behavior
portals/developer-portal/src/dao/apiDao.js, portals/developer-portal/src/services/apiMetadataService.js
API updates leave handles unchanged, and API file deletion returns 204 only when content exists.
File-based role scopes
portals/developer-portal/configs/config-platform-api.toml.example, portals/developer-portal/it/configs/config-platform-api-it.toml
Example and integration-test authentication entries use updated role-specific scopes.

Integration test lifecycle and REST coverage

Layer / File(s) Summary
Suite resource cleanup
portals/developer-portal/it/rest-api/support/cleanup.js, portals/developer-portal/it/rest-api/support/autoCleanup.js, portals/developer-portal/it/rest-api/support/client.js, portals/developer-portal/it/rest-api/jest.config.js, portals/developer-portal/it/rest-api/support/fixtures.js
Created top-level resources are tracked and deleted after each Jest suite, including multipart-created resources.
Container test execution and setup
portals/developer-portal/it/Makefile, portals/developer-portal/it/docker-compose.test.yaml
Docker Compose test targets capture service exit codes before teardown, and certificate generation handles missing files and ownership.
REST API test request contracts
portals/developer-portal/it/rest-api/api-content/api-content.spec.js, portals/developer-portal/it/rest-api/subscriptions/webhook-events.spec.js, portals/developer-portal/it/rest-api/apis/*
Multipart uploads use content, subscription creation uses artifactId, and comments reflect immutable API handles.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant RESTSpec
  participant postMultipart
  participant Cleanup
  participant Client
  RESTSpec->>postMultipart: Create multipart resource
  postMultipart->>Cleanup: Track response resource
  Cleanup->>Cleanup: Register collection, id, and role
  RESTSpec->>Cleanup: Run cleanupResources afterAll
  Cleanup->>Client: Delete tracked resources
Loading

Possibly related PRs

Suggested reviewers: chamilaadhi, ashera96, renuka-fernando, malinthaprasan, senthuran16

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers purpose, approach, and samples, but omits most required template sections like goals, tests, security, and environment. Add the missing template sections, especially Goals, User stories, Documentation, Automation tests, Security checks, Related PRs, and Test environment.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately summarizes the main change: fixing failing Devportal integration tests.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 16, 2026
@lasanthaS
lasanthaS merged commit fee5e46 into wso2:main Jul 17, 2026
9 checks passed
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.

2 participants