Skip to content

GET/ DELETE /v2/commitments - #918

Draft
wagnerd3 wants to merge 3 commits into
masterfrom
v2-commitment-get-delete
Draft

GET/ DELETE /v2/commitments #918
wagnerd3 wants to merge 3 commits into
masterfrom
v2-commitment-get-delete

Conversation

@wagnerd3

Copy link
Copy Markdown
Contributor

I will open this branch here as draft, so that the progress does not get lost or cause double work.
I had to switch back to the v2 report PR in the middle of this, so this is not finished.

What has been done:

  • I cherry-picked the necessary documentation and types from the v2-commitment-api branch
  • implemented DELETE API and tests (IIRC, the tests for this should be mostly complete and have okay coverage)
  • did some prep for GET in the form of mock setup for auth etc.

TODO:

  • implement GET + tests
  • check what the DELETE test covers and whether I missed anything important.

@github-actions

Copy link
Copy Markdown

Merging this branch will increase overall coverage

Impacted Packages Coverage Δ 🤖
github.com/sapcc/limes/internal/api/api_v2 74.40% (+2.10%) 👍
github.com/sapcc/limes/internal/apideclarations/apiv2 0.00% (ø)
github.com/sapcc/limes/internal/apideclarations/apiv2/common 0.00% (ø)
github.com/sapcc/limes/internal/apideclarations/apiv2/resources 0.00% (ø)
github.com/sapcc/limes/internal/core 80.93% (+0.03%) 👍
github.com/sapcc/limes/internal/test 93.55% (+0.07%) 👍

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/sapcc/limes/internal/api/api_v2/commitment_create.go 86.17% (ø) 752 648 104
github.com/sapcc/limes/internal/api/api_v2/commitment_delete.go 89.19% (+89.19%) 296 (+296) 264 (+264) 32 (+32) 🌟
github.com/sapcc/limes/internal/api/api_v2/commitment_helpers.go 95.52% (+0.44%) 536 (+48) 512 (+48) 24 👍
github.com/sapcc/limes/internal/api/api_v2/core.go 88.37% (+0.21%) 688 (+80) 608 (+72) 80 (+8) 👍
github.com/sapcc/limes/internal/apideclarations/apiv2/common/opts.go 0.00% (ø) 0 0 0
github.com/sapcc/limes/internal/apideclarations/apiv2/common/types.go 0.00% (ø) 42 (+42) 0 42 (+42)
github.com/sapcc/limes/internal/apideclarations/apiv2/doc.go 0.00% (ø) 0 0 0
github.com/sapcc/limes/internal/apideclarations/apiv2/resources/commitment.go 0.00% (ø) 0 0 0
github.com/sapcc/limes/internal/core/service_info_cache.go 85.84% (-0.00%) 1864 (+56) 1600 (+48) 264 (+8) 👎
github.com/sapcc/limes/internal/test/mock_enforcer.go 93.10% (+0.51%) 232 (+16) 216 (+16) 16 👍
github.com/sapcc/limes/internal/test/setup.go 92.48% (ø) 1064 984 80

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

Changed unit test files

  • github.com/sapcc/limes/internal/api/api_v2/commitment_delete_test.go
  • github.com/sapcc/limes/internal/core/service_info_cache_test.go

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.

1 participant