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

Clean-up APIv3 tests #5046

Merged
merged 1 commit into from
Dec 27, 2023
Merged

Clean-up APIv3 tests #5046

merged 1 commit into from
Dec 27, 2023

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Dec 27, 2023

Which problem is this PR solving?

Description of the changes

  • DRY the tests
  • Ensure no goroutines are leaked - pass tlscfg.Options by reference

How was this change tested?

  • unit tests

Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro added the changelog:test Change that's adding missing tests or correcting existing tests label Dec 27, 2023
Copy link

codecov bot commented Dec 27, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (d4e6ab4) 95.62% compared to head (e7a021a) 95.58%.

Files Patch % Lines
cmd/query/app/server.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5046      +/-   ##
==========================================
- Coverage   95.62%   95.58%   -0.04%     
==========================================
  Files         319      319              
  Lines       18794    18794              
==========================================
- Hits        17971    17965       -6     
- Misses        661      665       +4     
- Partials      162      164       +2     
Flag Coverage Δ
cassandra-3.x 25.61% <ø> (ø)
cassandra-4.x 25.61% <ø> (ø)
elasticsearch-5.x 19.88% <ø> (+0.01%) ⬆️
elasticsearch-6.x 19.87% <ø> (-0.02%) ⬇️
elasticsearch-7.x 20.00% <ø> (ø)
elasticsearch-8.x 20.09% <ø> (ø)
grpc-badger 19.50% <ø> (ø)
kafka 14.10% <ø> (ø)
opensearch-1.x 20.02% <ø> (+0.01%) ⬆️
opensearch-2.x 20.02% <ø> (ø)
unittests 93.33% <50.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@yurishkuro yurishkuro marked this pull request as ready for review December 27, 2023 07:04
@yurishkuro yurishkuro requested a review from a team as a code owner December 27, 2023 07:04
Copy link
Contributor

@albertteoh albertteoh left a comment

Choose a reason for hiding this comment

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

I don't quite understand how this removes the dependency on GRPC Gateway, but that's probably because I'm not so familiar with this part of the code.

@yurishkuro
Copy link
Member Author

It does not remove the dependency yet. I first want to have good tests that exercise v3 api via http, and then replace the gateway implementation.

@yurishkuro yurishkuro merged commit 2665047 into jaegertracing:main Dec 27, 2023
37 of 39 checks passed
@yurishkuro yurishkuro deleted the apiv3-gw branch December 27, 2023 15:03
yurishkuro added a commit that referenced this pull request Dec 28, 2023
## Which problem is this PR solving?
- Part of #5052
- Continuation of #5046

## Description of the changes
- Add tests for all HTTP APIs, not just GetTrace
- Use snapshots to make validation of HTTP/JSON response from the server
easier
- Replace grpc-gateway/runtime JSONPb marshaler (in tests) with
gogo/jsonpb marshaler

## Gaps
- The error conditions are not being tested currently, such as not
specifying the timestamps in the query

## How was this change tested?
- Unit tests

---------

Signed-off-by: Yuri Shkuro <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:test Change that's adding missing tests or correcting existing tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants