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

Adds tests for demo configuration java tool #3807

Conversation

DarshitChanpura
Copy link
Member

Description

This PR adds tests associated with the demo-configuration tool.

Issues Resolved:

Testing

  • Unit Testing
  • Integration Testing

Check List

  • New functionality includes testing
    - [ ] New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Merging #3807 (b865415) into main (06d8c29) will increase coverage by 1.36%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3807      +/-   ##
==========================================
+ Coverage   65.14%   66.50%   +1.36%     
==========================================
  Files         298      298              
  Lines       21196    21199       +3     
  Branches     3454     3454              
==========================================
+ Hits        13808    14099     +291     
+ Misses       5692     5379     -313     
- Partials     1696     1721      +25     
Files Coverage Δ
...pensearch/security/tools/democonfig/Installer.java 71.67% <100.00%> (+71.67%) ⬆️

... and 9 files with indirect coverage changes

@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Dec 8, 2023

continuing the discussion here from #3777 :

You've got an methods showHelp() and readOptions() both of these do not share any common code, there are many libraries such as those used by the SecurityAdmin that handle these use cases. Then rather than checking a string output you could verify the collection - or frankly not even verify that since its just configuration at that point.

Tests should verify something that can break the API / user contract. Consider the usage of the code and work backward for what should be tested.

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
… classes and configuration

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…luster

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…demo install script

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…he script execution fails

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura force-pushed the demo-config-java-tool-tests-only branch from 14ba7af to daa0fae Compare December 12, 2023 22:33
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura
Copy link
Member Author

ty @peternied for the feedback. I've addressed all comments and have refactored some tests.

Copy link
Contributor

@stephen-crawford stephen-crawford left a comment

Choose a reason for hiding this comment

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

Looks good to me! Thanks DC!

@stephen-crawford stephen-crawford merged commit e698315 into opensearch-project:main Dec 13, 2023
82 checks passed
DarshitChanpura added a commit to DarshitChanpura/security that referenced this pull request Dec 13, 2023
### Description
This PR adds tests associated with the demo-configuration tool.

## Issues Resolved:
 - Resolves opensearch-project#3636

### Testing
- Unit Testing
- Integration Testing

### Check List
- [x] New functionality includes testing
~- [ ] New functionality has been documented~
- [x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
cwperks pushed a commit that referenced this pull request Dec 18, 2023
…t for Bundled JDK for this tool and updates DEVELOPER_GUIDE.md (#3845)

### Description
Backports following commits related to demo configuration tool from main
to 2.x:

- [x]
[17748b9](17748b9)
from #3669
- [x]
[4496440](4496440)
from #3734
- [x]
[06d8c29](06d8c29)
from #3777
- [x]
[e698315](e698315)
from #3807
- [x]
[9d11524](9d11524)
from #3843
- [x]
[62aed21](62aed21)
from #3850
- [x]
[ceabe13](ceabe13)
from #3844

### Issues Resolved
- Related to #3827


### Testing
- automated tests

### Check List
- [x] New functionality includes testing
- [x] New functionality has been documented
- [x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <35282393+DarshitChanpura@users.noreply.github.com>
prabhask5 pushed a commit to prabhask5/opensearch-security that referenced this pull request Jan 11, 2024
### Description
This PR adds tests associated with the demo-configuration tool.

## Issues Resolved:
 - Resolves opensearch-project#3636

### Testing
- Unit Testing
- Integration Testing

### Check List
- [x] New functionality includes testing
~- [ ] New functionality has been documented~
- [x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Prabhas Kurapati <prabhask@berkeley.edu>
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
### Description
This PR adds tests associated with the demo-configuration tool.

## Issues Resolved:
 - Resolves opensearch-project#3636

### Testing
- Unit Testing
- Integration Testing

### Check List
- [x] New functionality includes testing
~- [ ] New functionality has been documented~
- [x] Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
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.

Implement tests to verify changes to default admin credentials
3 participants