Skip to content

Conversation

asimchoudhary
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • created unit tests for the create.sh file , to test for various cases such as presence of Mode parameter , output for specific parameters

How was this change tested?

Checklist

Signed-off-by: asim <aktech701@gmail.com>
@asimchoudhary asimchoudhary requested a review from a team as a code owner January 22, 2025 19:21
@asimchoudhary asimchoudhary requested a review from jkowall January 22, 2025 19:21
@dosubot dosubot bot added the area/storage label Jan 22, 2025
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

🚀

@yurishkuro yurishkuro added the changelog:test Change that's adding missing tests or correcting existing tests label Jan 22, 2025
@yurishkuro
Copy link
Member

It doesn't look like the test is being run in the CI, I only see compute-tags test being run.

https://github.com/jaegertracing/jaeger/actions/runs/12915527527/job/36017583978?pr=6594#step:8:1

Copy link

codecov bot commented Jan 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.10%. Comparing base (3222e01) to head (d28b310).
Report is 8 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6594      +/-   ##
==========================================
- Coverage   96.21%   96.10%   -0.12%     
==========================================
  Files         375      366       -9     
  Lines       21397    20949     -448     
==========================================
- Hits        20588    20133     -455     
- Misses        616      620       +4     
- Partials      193      196       +3     
Flag Coverage Δ
badger_v1 9.57% <ø> (-1.06%) ⬇️
badger_v2 1.75% <ø> (-1.04%) ⬇️
cassandra-4.x-v1-manual 15.29% <ø> (-1.36%) ⬇️
cassandra-4.x-v2-auto 1.74% <ø> (-0.98%) ⬇️
cassandra-4.x-v2-manual 1.74% <ø> (-0.98%) ⬇️
cassandra-5.x-v1-manual 15.29% <ø> (-1.36%) ⬇️
cassandra-5.x-v2-auto 1.74% <ø> (-0.98%) ⬇️
cassandra-5.x-v2-manual 1.74% <ø> (-0.98%) ⬇️
elasticsearch-6.x-v1 19.42% <ø> (-1.02%) ⬇️
elasticsearch-7.x-v1 19.50% <ø> (-1.01%) ⬇️
elasticsearch-8.x-v1 19.67% <ø> (-1.00%) ⬇️
elasticsearch-8.x-v2 1.75% <ø> (-1.04%) ⬇️
grpc_v1 11.02% <ø> (-1.17%) ⬇️
grpc_v2 7.77% <ø> (-1.29%) ⬇️
kafka-3.x-v1 9.86% <ø> (-0.50%) ⬇️
kafka-3.x-v2 1.75% <ø> (-1.04%) ⬇️
memory_v2 1.75% <ø> (-1.04%) ⬇️
opensearch-1.x-v1 19.55% <ø> (-1.01%) ⬇️
opensearch-2.x-v1 19.55% <ø> (-1.00%) ⬇️
opensearch-2.x-v2 1.86% <ø> (-0.93%) ⬇️
tailsampling-processor 0.47% <ø> (-0.05%) ⬇️
unittests 94.93% <ø> (-0.14%) ⬇️

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
Copy link
Member

.github/workflows/ci-lint-checks.yaml
119:        SHUNIT2=.tools/shunit2 bash scripts/utils/compute-tags.test.sh

Let's create a single wrapper scripts/utils/run-tests.sh and call it from the workflow, and inside that script call individual scripts.

I prefer not to use auto-discovery (like *.test.sh) in case we change the naming or move stuff.

@asimchoudhary
Copy link
Contributor Author

On it !

@asimchoudhary
Copy link
Contributor Author

@yurishkuro sir , is there a way to run the ci pipeline (ci-lint-checks.yaml) on my forked version ?
i want to test the changes before raising the pr

@yurishkuro
Copy link
Member

I don't think you can run the actual workflow, but you can run individual commands from it

Signed-off-by: asim <aktech701@gmail.com>
Signed-off-by: asim <aktech701@gmail.com>
@asimchoudhary
Copy link
Contributor Author

@yurishkuro sir , can you please review the changes and give me feedback.

@@ -12,175 +12,174 @@ concurrency:
cancel-in-progress: true

# See https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions
permissions: # added using https://github.com/step-security/secure-workflows
permissions: # added using https://github.com/step-security/secure-workflows
Copy link
Member

Choose a reason for hiding this comment

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

if there are changes needed to this file it should be in one line, not across the whole file. Please revert.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screencast.from.2025-01-24.22-51-49.webm

when i am changing the
line no. 119
SHUNIT2=.tools/shunit2 bash scripts/utils/compute-tags.test.sh to
SHUNIT2=.tools/shunit2 bash scripts/utils/run-tests.sh

after saving it , new indentation is introduced across the file , which is causing the changes in the whole file

Sir , can you please advice me on how to stop this auto formatting

Copy link
Member

Choose a reason for hiding this comment

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

Use a different editor (like plain vi) that does not do any auto-formatting.

Signed-off-by: asim <aktech701@gmail.com>
@asimchoudhary
Copy link
Contributor Author

@yurishkuro sir , i have made the required changes , can you please review them .

@yurishkuro yurishkuro changed the title Added unit tests for the create.sh script Add unit tests for the cassandra/schema/create.sh script Jan 25, 2025
@yurishkuro yurishkuro merged commit c2ea27a into jaegertracing:main Jan 25, 2025
55 checks passed
@yurishkuro
Copy link
Member

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage 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