Skip to content
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

Automated testing of REST API #550

Merged
merged 27 commits into from
Jan 15, 2025
Merged

Automated testing of REST API #550

merged 27 commits into from
Jan 15, 2025

Conversation

krestenlaust
Copy link
Member

@krestenlaust krestenlaust commented Jan 8, 2025

This PR aims to implement automating testing using example data in the API spec.

Plan:

  • Fix inconsistencies in api spec to be parsable by Dredd
  • Create Stregsystem fixture based on examples in api spec
  • Correct potential errors discovered
  • Create github workflow that runs Dredd automatically on PRs

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.81%. Comparing base (a02bfdb) to head (59549f9).
Report is 6 commits behind head on next.

Additional details and impacted files
@@            Coverage Diff             @@
##             next     #550      +/-   ##
==========================================
+ Coverage   80.80%   80.81%   +0.01%     
==========================================
  Files          40       40              
  Lines        3809     3811       +2     
  Branches      481      481              
==========================================
+ Hits         3078     3080       +2     
  Misses        675      675              
  Partials       56       56              

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

Using $ref inside an example isn't valid (apparently)
@krestenlaust krestenlaust changed the title feat: Automated rest API testing feat: Automated testing of REST API Jan 8, 2025
@krestenlaust krestenlaust marked this pull request as ready for review January 10, 2025 16:53
@krestenlaust krestenlaust mentioned this pull request Jan 11, 2025
4 tasks
@Mast3rwaf1z Mast3rwaf1z self-requested a review January 13, 2025 15:58
Copy link
Member

@Mast3rwaf1z Mast3rwaf1z left a comment

Choose a reason for hiding this comment

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

most of the comments i'm fine with just a reply, but there's some small things with the code i'd like to be considered

generally i think we should clean up the project root, and another file (dredd.yml) doesn't help

.github/workflows/openapi.yml Outdated Show resolved Hide resolved
dredd.yml Outdated Show resolved Hide resolved
openapi/dredd_hook.py Show resolved Hide resolved
openapi/dredd_hook.py Outdated Show resolved Hide resolved
openapi/utils.py Outdated Show resolved Hide resolved
openapi/utils.py Outdated Show resolved Hide resolved
openapi/utils.py Outdated Show resolved Hide resolved
openapi/utils.py Outdated Show resolved Hide resolved
stregsystem/views.py Show resolved Hide resolved
openapi/utils.py Show resolved Hide resolved
@krestenlaust krestenlaust changed the title feat: Automated testing of REST API Automated testing of REST API Jan 14, 2025
Copy link
Member

@Mast3rwaf1z Mast3rwaf1z left a comment

Choose a reason for hiding this comment

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

lgtm, works on my machine 👍

@krestenlaust krestenlaust merged commit 2524a13 into next Jan 15, 2025
4 checks passed
@krestenlaust krestenlaust deleted the feat/openapi-dredd-test branch January 15, 2025 09:25
@krestenlaust krestenlaust removed the request for review from AshesOfEther January 15, 2025 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants