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

Add hardcoded DB password and username to Cassandra integration test #5805

Merged
merged 11 commits into from
Aug 23, 2024

Conversation

Ali-Alnosairi
Copy link
Contributor

Which problem is this PR solving?

Description of the changes

  • add db password and username to cassandra-integration-test.sh
  • add db password and username to config-cassandra.yaml
  • both password and username are hardcoded in the code

How was this change tested?

  • bash scripts/cassandra-integration-test.sh 3 v003 v1
  • bash scripts/cassandra-integration-test.sh 3 v003 v2
  • bash scripts/cassandra-integration-test.sh 4 v004 v1
  • bash scripts/cassandra-integration-test.sh 4 v004 v2

Checklist

@Ali-Alnosairi
Copy link
Contributor Author

Hi @yurishkuro,
Would you please review the changes please.

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.

what local testing did you do to ensure that these changes are correct?

@@ -48,14 +52,16 @@ run_integration_test() {
local major_version=${version%%.*}
local schema_version=$2
local jaegerVersion=$3
local username="username"
local password="password"
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 function need to change? If you need to reuse these values, make them global vars. If you don't need to reuse them then just pass constant strings in the one place where they are needed?

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 added username and password as vars in cassandra-integration-test just to align with how keyspaces are managed, so even the keyspace can be passed as constant string to the apply-schema() but it is done as vars.
Another case if it is decided to pass username and password from the main() as user input or from the CI, this would be great start for that.

scripts/cassandra-integration-test.sh Show resolved Hide resolved
@yurishkuro
Copy link
Member

This script IS the CI.

@yurishkuro yurishkuro added the changelog:ci Change related to continuous integration / testing label Aug 20, 2024
… through docker-compose

Signed-off-by: Ali-Alnosairi <alialnosiari@gmail.com>
… to enable authentication

Signed-off-by: Ali-Alnosairi <alialnosiari@gmail.com>
Signed-off-by: Ali-Alnosairi <alialnosiari@gmail.com>
@yurishkuro
Copy link
Member

make sure to rebase on main, it will pull changes that give better logging in v2 tests

@Ali-Alnosairi
Copy link
Contributor Author

@yurishkuro

Would you please review the changes!

I think it is finally ready.

Copy link

codecov bot commented Aug 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.82%. Comparing base (865dd5d) to head (3c344cc).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5805      +/-   ##
==========================================
+ Coverage   96.81%   96.82%   +0.01%     
==========================================
  Files         342      342              
  Lines       16525    16520       -5     
==========================================
- Hits        15998    15996       -2     
+ Misses        340      338       -2     
+ Partials      187      186       -1     
Flag Coverage Δ
badger_v1 8.05% <ø> (+<0.01%) ⬆️
badger_v2 1.81% <ø> (+<0.01%) ⬆️
cassandra-3.x-v1 16.62% <ø> (+0.01%) ⬆️
cassandra-3.x-v2 1.74% <ø> (+<0.01%) ⬆️
cassandra-4.x-v1 16.62% <ø> (+0.01%) ⬆️
cassandra-4.x-v2 1.74% <ø> (+<0.01%) ⬆️
elasticsearch-6.x-v1 18.78% <ø> (+0.01%) ⬆️
elasticsearch-7.x-v1 18.84% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v1 19.05% <ø> (+0.01%) ⬆️
elasticsearch-8.x-v2 1.80% <ø> (+<0.01%) ⬆️
grpc_v1 9.48% <ø> (-0.04%) ⬇️
grpc_v2 7.14% <ø> (+<0.01%) ⬆️
kafka-v1 9.74% <ø> (+<0.01%) ⬆️
kafka-v2 1.81% <ø> (+<0.01%) ⬆️
memory_v2 1.81% <ø> (+<0.01%) ⬆️
opensearch-1.x-v1 18.89% <ø> (-0.01%) ⬇️
opensearch-2.x-v1 18.90% <ø> (+0.01%) ⬆️
opensearch-2.x-v2 1.81% <ø> (+<0.01%) ⬆️
unittests 95.30% <ø> (+0.01%) ⬆️

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.

Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
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.

Thanks!

@yurishkuro yurishkuro merged commit b8e2c81 into jaegertracing:main Aug 23, 2024
45 checks passed
@Ali-Alnosairi
Copy link
Contributor Author

@yurishkuro Thank you for your help and guidance.
Looking forward to contributing more.

JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this pull request Aug 28, 2024
…aegertracing#5805)

## Which problem is this PR solving?
- Resolves jaegertracing#5643

## Description of the changes
- add db password and username to cassandra-integration-test.sh
- add db password and username to config-cassandra.yaml
- both password and username are hardcoded in the code

## How was this change tested?
- `bash scripts/cassandra-integration-test.sh 3 v003 v1`
- `bash scripts/cassandra-integration-test.sh 3 v003 v2`
- `bash scripts/cassandra-integration-test.sh 4 v004 v1 `
- `bash scripts/cassandra-integration-test.sh 4 v004 v2`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ali-Alnosairi <alialnosiari@gmail.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Jared Tan <jian.tan@daocloud.io>
mahadzaryab1 pushed a commit to mahadzaryab1/jaeger that referenced this pull request Aug 31, 2024
…aegertracing#5805)

## Which problem is this PR solving?
- Resolves jaegertracing#5643

## Description of the changes
- add db password and username to cassandra-integration-test.sh
- add db password and username to config-cassandra.yaml
- both password and username are hardcoded in the code

## How was this change tested?
- `bash scripts/cassandra-integration-test.sh 3 v003 v1`
- `bash scripts/cassandra-integration-test.sh 3 v003 v2`
- `bash scripts/cassandra-integration-test.sh 4 v004 v1 `
- `bash scripts/cassandra-integration-test.sh 4 v004 v2`

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Ali-Alnosairi <alialnosiari@gmail.com>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Co-authored-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage changelog:ci Change related to continuous integration / testing storage/cassandra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use db password in Cassandra integration tests
2 participants