Skip to content

Addons: create a suite tests for Addons API endpoint #10685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
humitos opened this issue Aug 30, 2023 · 1 comment · Fixed by #10754
Closed

Addons: create a suite tests for Addons API endpoint #10685

humitos opened this issue Aug 30, 2023 · 1 comment · Fixed by #10754
Assignees
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@humitos
Copy link
Member

humitos commented Aug 30, 2023

We need to create a good amount of tests for this API endpoint so we are covered.

@humitos humitos added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Aug 30, 2023
@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap Aug 30, 2023
@humitos humitos self-assigned this Sep 6, 2023
humitos added a commit that referenced this issue Sep 18, 2023
Use `unresolved_url` to get the final project requested from the URL. This is
needed for subproject since it's the only place where it's present.

Previously, we were getting the project from the `unresolved_domain` which does
not give us the `subproject` because it's not present in the domain itself.

Tests will be added in
#10685

Closes readthedocs/readthedocs-corporate#1622
@humitos
Copy link
Member Author

humitos commented Sep 18, 2023

Add tests for the HTTP headers and also for the enabled/disabled queryset: #10733

humitos added a commit that referenced this issue Sep 18, 2023
When a request is made with a URL containing an invalid version (e.g.
http://test-builds.devthedocs.org/_/addons/?url=http%3A%2F%2Ftest-builds.devthedocs.org%2Fen%<invalid-version-here>%2F)
this class fails and returns a 500.

This fixes this issue by letting the request to continue and be handled
downstream by the view itself. The error has been reported on Sentry:
https://read-the-docs.sentry.io/issues/4457263897/events/recommended/?project=148442&query=is%3Aunresolved+%21message%3A%22%21message%3A%22%21message%3A%22SystemExit%22+%21message%3A%22frame-ancestors%22&referrer=recommended-event&stream_index=1

I will add a specific test for this in #10685.
humitos added a commit that referenced this issue Sep 19, 2023
Use `unresolved_url` to get the final project requested from the URL. This is
needed for subproject since it's the only place where it's present.

Previously, we were getting the project from the `unresolved_domain` which does
not give us the `subproject` because it's not present in the domain itself.

Tests will be added in
#10685

Closes readthedocs/readthedocs-corporate#1622
@humitos humitos moved this from Planned to In progress in 📍Roadmap Sep 19, 2023
@humitos humitos moved this from In progress to Needs review in 📍Roadmap Sep 19, 2023
humitos added a commit that referenced this issue Sep 19, 2023
humitos added a commit that referenced this issue Oct 16, 2023
* Addons: add test cases for the endpoint

Closes #10685

* Missing field on JSON response for test

* Revert "Missing field on JSON response for test"

This reverts commit 3b1fdb8.
@github-project-automation github-project-automation bot moved this from Needs review to Done in 📍Roadmap Oct 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant