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

Use entire api object in API tests. #15

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Use entire api object in API tests. #15

merged 3 commits into from
Jan 15, 2025

Conversation

plietar
Copy link
Member

@plietar plietar commented Jan 10, 2025

The API tests used to setup individual endpoints to run the tests. That is a bit verbose and duplicates a bunch of code from the api.R file.

This will be made much worse when we introduce url parameters to all the endpoints, since all the tests will need to make a API call to fetch the repository first, which will lead to more boilerplate.

Using the api object solves this issue.

@plietar plietar force-pushed the refactor-api-test branch 2 times, most recently from 784dab2 to 6ca7e58 Compare January 14, 2025 12:14
@plietar plietar changed the base branch from mrc-6120 to main January 14, 2025 12:14
@plietar plietar requested a review from M-Kusumgar January 14, 2025 12:15
@plietar plietar marked this pull request as ready for review January 14, 2025 12:15
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.35%. Comparing base (b69faac) to head (86b5002).
Report is 99 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #15      +/-   ##
==========================================
- Coverage   99.44%   99.35%   -0.10%     
==========================================
  Files           8        8              
  Lines         179      308     +129     
==========================================
+ Hits          178      306     +128     
- Misses          1        2       +1     

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

Copy link
Contributor

@M-Kusumgar M-Kusumgar left a comment

Choose a reason for hiding this comment

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

Looks nicer, thanks

The API tests used to setup individual endpoints to run the tests. That
is a bit verbose and duplicates a bunch of code from the `api.R` file.

This will be made much worse when we introduce `url` parameters to all
the endpoints, since all the tests will need to make a API call to fetch
the repository first, which will lead to more boilerplate.

Using the api object solves this issue.
@plietar plietar merged commit 42b295d into main Jan 15, 2025
7 checks passed
@plietar plietar deleted the refactor-api-test branch January 15, 2025 15:57
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