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

Expose storage integration helpers as go pkg #3944

Merged
merged 1 commit into from
Oct 6, 2022

Conversation

arajkumar
Copy link
Contributor

@arajkumar arajkumar commented Oct 4, 2022

Which problem is this PR solving?

gRPC storage implementations which lives out of tree has to copy integration test helpers and fixtures.

Short description of the changes

This commit exposes storage integration test helpers as golang packages so that out of tree grpc storage implementations can import and run tests from their context.

Prior to this change out of tree implementations copies these files into their repo[1]. This is not good in terms of keeping fixtures upto date.

This commit does the following,

  • Rename test helper files(integration_test.go => integration.go, trace_compare_test.go => test_compare.go) to expose those as go packages.
  • Use go embed instead of os.ReadFile package to read test fixtures, this helps to reuse fixtures
  • Add a field in StorageIntegration struct to skip tests

[1] https://github.com/jaegertracing/jaeger-clickhouse/tree/main/integration

Signed-off-by: Arunprasad Rajkumar [email protected]

@arajkumar arajkumar requested a review from a team as a code owner October 4, 2022 18:15
@codecov
Copy link

codecov bot commented Oct 4, 2022

Codecov Report

Base: 97.68% // Head: 97.13% // Decreases project coverage by -0.55% ⚠️

Coverage data is based on head (584e107) compared to base (e3bbf7e).
Patch coverage: 57.89% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3944      +/-   ##
==========================================
- Coverage   97.68%   97.13%   -0.56%     
==========================================
  Files         293      295       +2     
  Lines       17080    17389     +309     
==========================================
+ Hits        16684    16890     +206     
- Misses        313      401      +88     
- Partials       83       98      +15     
Impacted Files Coverage Δ
plugin/storage/integration/trace_compare.go 36.17% <ø> (ø)
plugin/storage/integration/integration.go 76.33% <57.89%> (ø)
pkg/config/tlscfg/cert_watcher.go 92.55% <0.00%> (-2.13%) ⬇️
cmd/query/app/static_handler.go 96.38% <0.00%> (-1.81%) ⬇️
cmd/query/app/server.go 94.64% <0.00%> (-1.34%) ⬇️
plugin/storage/badger/spanstore/reader.go 95.49% <0.00%> (-0.72%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@yurishkuro
Copy link
Member

perhaps we should add .nocover to this package, because it's going to be dragging the coverage down, since it has a bunch of code that is only executed in case of test failures, so to have it covered we'd need to simulate those failures with some mock test suite (ideally we'd do exactly that, but it's some extra work).

The .nocover should contain FIXME, e.g.

FIXME - branches for storage test failures are not covered

@arajkumar arajkumar force-pushed the integration-pkg branch 2 times, most recently from cdef2ab to fb036e4 Compare October 5, 2022 03:19
This commit exposes storage integration test helpers as golang packages so that out of tree grpc storage implementations can import and run tests from their context.

Prior to this change out of tree implementations copies these files into their repo[1]. This is not good in terms of keeping fixtures upto date.

This commit does the following,
- Rename test helper files(integration_test.go => integration.go, trace_compare_test.go => test_compare.go) to expose those as go packages.
- Use `go embed` instead of `os.ReadFile` package to read test fixtures, this helps to reuse fixtures
- Add a field in StorageIntegration struct to skip tests

[1] https://github.com/jaegertracing/jaeger-clickhouse/tree/main/integration

Signed-off-by: Arunprasad Rajkumar <[email protected]>
@yurishkuro
Copy link
Member

my bad, .nocover only takes effect in dirs that have .go files without tests.

@yurishkuro yurishkuro merged commit 5bf8a28 into jaegertracing:main Oct 6, 2022
arajkumar added a commit to arajkumar/promscale that referenced this pull request Oct 6, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/promscale that referenced this pull request Oct 6, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/promscale that referenced this pull request Oct 6, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
@arajkumar
Copy link
Contributor Author

Thanks @yurishkuro

arajkumar added a commit to arajkumar/promscale that referenced this pull request Oct 14, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/promscale that referenced this pull request Oct 14, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to arajkumar/promscale that referenced this pull request Oct 14, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
arajkumar added a commit to timescale/promscale that referenced this pull request Oct 14, 2022
This commit reuses fixtures from upstream jaeger[1] which is exposed
as golang pkg.

Though we use non release version v1.38.2-0.20221006002917-5bf8a28fe06d, it doesn't have any other changes except [1] which is safe.

[1] jaegertracing/jaeger#3944

Signed-off-by: Arunprasad Rajkumar <[email protected]>
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