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

[VIRTS-2717] Operations API Tests #2219

Merged
merged 35 commits into from
Sep 7, 2021

Conversation

bleepbop
Copy link
Contributor

Description

Pytest unittests for the v2 Operations API. Note: the DELETE endpoint is currently untested, as there seems to be an underlying aiohttp issue with v3.6.2, causing a failure when running with tox.

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Verified that tests work for various python versions using tox.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

@codecov
Copy link

codecov bot commented Aug 12, 2021

Codecov Report

Merging #2219 (06f155c) into master (b51b51a) will increase coverage by 2.33%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2219      +/-   ##
==========================================
+ Coverage   68.71%   71.04%   +2.33%     
==========================================
  Files          94       94              
  Lines        7419     7419              
==========================================
+ Hits         5098     5271     +173     
+ Misses       2321     2148     -173     
Impacted Files Coverage Δ
app/objects/secondclass/c_link.py 87.90% <0.00%> (+0.46%) ⬆️
app/objects/c_operation.py 72.26% <0.00%> (+0.84%) ⬆️
app/api/v2/managers/base_api_manager.py 79.82% <0.00%> (+0.87%) ⬆️
app/contacts/contact_websocket.py 81.48% <0.00%> (+7.40%) ⬆️
app/service/event_svc.py 67.27% <0.00%> (+9.09%) ⬆️
app/api/v2/handlers/operation_api.py 98.52% <0.00%> (+36.76%) ⬆️
app/api/v2/managers/operation_api_manager.py 88.77% <0.00%> (+59.35%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b51b51a...06f155c. Read the comment docs.

@bleepbop bleepbop marked this pull request as draft August 12, 2021 20:04
@bleepbop bleepbop marked this pull request as ready for review August 13, 2021 00:42
@bleepbop bleepbop requested a review from uruwhy August 13, 2021 00:42
Copy link
Contributor

@uruwhy uruwhy left a comment

Choose a reason for hiding this comment

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

Looking great! Couple other addition's that would help with completeness:

  • Testing behavior for nonexistent operation IDs / link IDs
  • Testing certain edge cases, like trying to update or create a finished operation.

tests/api/v2/handlers/test_operations_api.py Outdated Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Outdated Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Outdated Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Outdated Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Show resolved Hide resolved
tests/api/v2/handlers/test_operations_api.py Outdated Show resolved Hide resolved
@sonarcloud
Copy link

sonarcloud bot commented Aug 13, 2021

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

tests/conftest.py Outdated Show resolved Hide resolved
Copy link
Contributor

@uruwhy uruwhy left a comment

Choose a reason for hiding this comment

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

Few small changes here and there, but overall looks great!

@bleepbop bleepbop requested a review from uruwhy August 18, 2021 19:11
uruwhy
uruwhy previously approved these changes Aug 18, 2021
Copy link
Contributor

@uruwhy uruwhy left a comment

Choose a reason for hiding this comment

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

Looks good to me!

uruwhy
uruwhy previously approved these changes Aug 25, 2021
@bleepbop bleepbop requested a review from uruwhy August 27, 2021 12:49
@sonarcloud
Copy link

sonarcloud bot commented Sep 7, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bleepbop bleepbop merged commit 07adcdb into master Sep 7, 2021
@bleepbop bleepbop deleted the bleepbop/VIRTS-2002/operations-api-tests branch September 7, 2021 16:49
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.

3 participants