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

Control lightweight storage integration tests via build tags #3346

Merged

Conversation

rbroggi
Copy link
Contributor

@rbroggi rbroggi commented Oct 28, 2021

  • introduce build tags grpc_storage_integration, badger_storage_integration, and memory_storage_integration for better control over badgerstore_test.go and grpc_test.go
  • run memory storage test as part of make-test, and run badger/grpc in a separate CI workflow

Which problem is this PR solving?

Short description of the changes

  • Integration of two build tags that enable ease control of when badge and grpc_plugin tests must be run

@rbroggi rbroggi requested a review from a team as a code owner October 28, 2021 17:57
@rbroggi rbroggi force-pushed the 1516-storage-integration-tests branch from 7af3a5c to df4cccc Compare October 28, 2021 17:59
@rbroggi
Copy link
Contributor Author

rbroggi commented Oct 28, 2021

Hello all, this is my first time around :)

I'm a Jaeger user and a fan of the product. Being part somehow of the project is something that will make me very proud.

Two days ago I also discovered the hacktoberfest initiative and was very happy to find Jaeger issues there.

I hope we make it on time to make this PR ready before time is up for hacktoberfest but if it will not be possible, no problem at all :)

I wish you a pleasant day/evening

@@ -11,6 +11,8 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//go:build grpc_plugin_storage_integration
// +build grpc_plugin_storage_integration
Copy link
Member

Choose a reason for hiding this comment

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

why does this need to be conditional? this only builds the binary when requested

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It indeed does not need to be conditional. If you prefer I can remove it. It was only a way to 'link' the execution of the grpc_test.go. I understand also that this file has no need to be compiled in other scopes, is this right? Anyhow for me there is no problem if you prefer to eliminate the compilation tags for this file.

Copy link
Member

@yurishkuro yurishkuro Oct 29, 2021

Choose a reason for hiding this comment

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

I would remove the tag. Someone needs to explicitly invoke the build of this module, so having an extra protection via tag just adds more friction.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Makefile Outdated Show resolved Hide resolved
* introduction of build tags [grpc_plugin_storage_integration, badger_storage_integration] for better control over badgerstore_test.go and grpc_test.go  which being fairly light-weight can be run along with the main make target `test`

Signed-off-by: rbroggi <[email protected]>
@rbroggi rbroggi force-pushed the 1516-storage-integration-tests branch from 029ffcf to c63d9ae Compare October 29, 2021 16:30
@codecov
Copy link

codecov bot commented Oct 29, 2021

Codecov Report

Merging #3346 (fa791a0) into master (77e5674) will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3346      +/-   ##
==========================================
- Coverage   96.48%   96.46%   -0.02%     
==========================================
  Files         259      259              
  Lines       15166    15166              
==========================================
- Hits        14633    14630       -3     
- Misses        450      452       +2     
- Partials       83       84       +1     
Impacted Files Coverage Δ
cmd/query/app/static_handler.go 97.00% <0.00%> (-1.80%) ⬇️

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 77e5674...fa791a0. Read the comment docs.

@yurishkuro yurishkuro changed the title Issue #1516 https://github.com/jaegertracing/jaeger/issues/1516 Control storage integration tests via build tags Oct 29, 2021
@@ -1,20 +0,0 @@
name: CIT Memory And Badger
Copy link
Member

Choose a reason for hiding this comment

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

why are you removing this workflow?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought to remove it because the only thing it did was to run make mem-and-badger-storage-integration-test and now the whole suite included in make mem-and-badger-storage-integration-test is actually run along with the target test. Makes sense? I thought it was redundant, but I might have misunderstood.

Copy link
Member

Choose a reason for hiding this comment

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

makes sense.

Copy link
Member

Choose a reason for hiding this comment

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

Actually, one reason why I wanted to have build tags was so that memory/badger storage tests would not need to run when we run ES/Cassandra tests. But they still seem to run per https://github.com/jaegertracing/jaeger/runs/4048978413?check_suite_focus=true

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree they should not run. Let me check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I simply did not use a build-tag for those tests.

Please let me know if you prefer to have a unique tag for all the 3 tests (grpc/badge/memory) instead of one for each

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rbroggi
Copy link
Contributor Author

rbroggi commented Oct 29, 2021

Is CIT Elasticsearch / opensearch 1.x (pull_request) expected to fail?

Nothing has been touched in the scope of those tests...

@rbroggi rbroggi force-pushed the 1516-storage-integration-tests branch from 230e931 to 95675b3 Compare October 29, 2021 19:11
@rbroggi
Copy link
Contributor Author

rbroggi commented Oct 29, 2021

Codecov Report

Merging #3346 (95675b3) into master (8b7772e) will decrease coverage by 1.41%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3346      +/-   ##
==========================================
- Coverage   96.01%   94.60%   -1.42%     
==========================================
  Files         261      261              
  Lines       15464    15464              
==========================================
- Hits        14848    14629     -219     
- Misses        523      751     +228     
+ Partials       93       84       -9     

Impacted Files Coverage Δ
plugin/storage/integration/integration.go 0.00% <0.00%> (-79.29%)
plugin/storage/integration/trace_compare.go 0.00% <0.00%> (-36.18%)
cmd/query/app/server.go 94.11% <0.00%> (-1.48%)
plugin/storage/badger/spanstore/reader.go 95.50% <0.00%> (-0.71%)
cmd/query/app/static_handler.go 97.60% <0.00%> (+1.79%)
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 8b7772e...95675b3. Read the comment docs.

I'm surprised about the outcome 🤔

Do you think we were doubly counting anything on the coverage?

@yurishkuro
Copy link
Member

I doubt it, coverage is reported with the identity of lines of code, so codecov will merge them, not double count.

@rbroggi
Copy link
Contributor Author

rbroggi commented Oct 30, 2021

Codecov Report

Merging #3346 (95675b3) into master (8b7772e) will decrease coverage by 1.41%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3346      +/-   ##
==========================================
- Coverage   96.01%   94.60%   -1.42%     
==========================================
  Files         261      261              
  Lines       15464    15464              
==========================================
- Hits        14848    14629     -219     
- Misses        523      751     +228     
+ Partials       93       84       -9     

Impacted Files Coverage Δ
plugin/storage/integration/integration.go 0.00% <0.00%> (-79.29%)
plugin/storage/integration/trace_compare.go 0.00% <0.00%> (-36.18%)
cmd/query/app/server.go 94.11% <0.00%> (-1.48%)
plugin/storage/badger/spanstore/reader.go 95.50% <0.00%> (-0.71%)
cmd/query/app/static_handler.go 97.60% <0.00%> (+1.79%)
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 8b7772e...95675b3. Read the comment docs.

I'm surprised about the outcome thinking

Do you think we were doubly counting anything on the coverage?

After checking better the report here is what I found:

The gap in coverability comes massively from plugin/storage/integration/integration.go and plugin/storage/integration/trace_compare.go which, by their content, sound to me as test-utility functions, and therefore I think they would be perfectly eligible to be excluded from coverability altogether. WDYT?

We can access the exclusion of those files in a different PR. I think I understood the source of the issue:

The new tags were not used in the cover make target. I have updated the PR.

…ation,memory_storage_integration` should be present in `cover` profile and in `test` profile.

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

Unit tests fail on gRPC plugin integration tests. I would not necessarily consider it a "cheap" storage since it requires building the plugin binary first, so not a good candidate for quick make test.

My recommendation is to only keep memory test as "cheap" (and therefore not use the tag "cheap*" but explicitly memory_storage_integration), and do grpc + badger as a standalone GH Actions workflow as we had before.

@rbroggi
Copy link
Contributor Author

rbroggi commented Oct 30, 2021

Unit tests fail on gRPC plugin integration tests. I would not necessarily consider it a "cheap" storage since it requires building the plugin binary first, so not a good candidate for quick make test.

My recommendation is to only keep memory test as "cheap" (and therefore not use the tag "cheap*" but explicitly memory_storage_integration), and do grpc + badger as a standalone GH Actions workflow as we had before.

single tag for grpc+ badger? or prefer to keep 2 distinct ?

* including memory-integration-storage as a cheap integration test to run along with `make test`
* adapt the name of the ci workflow

Signed-off-by: rbroggi <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro changed the title Control storage integration tests via build tags Control lightweight storage integration tests via build tags Oct 30, 2021
@yurishkuro yurishkuro enabled auto-merge (squash) October 30, 2021 21:24
@yurishkuro yurishkuro merged commit 7844198 into jaegertracing:master Oct 30, 2021
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