-
Notifications
You must be signed in to change notification settings - Fork 404
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
Read the Pravega ZK and BK configuration option from an input Json file for system tests. #7073
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #7073 +/- ##
=========================================
Coverage 86.37% 86.38%
- Complexity 16084 16085 +1
=========================================
Files 1031 1031
Lines 59890 59890
Branches 6094 6094
=========================================
+ Hits 51732 51733 +1
+ Misses 4984 4981 -3
- Partials 3174 3176 +2 ☔ View full report in Codecov by Sentry. |
96f7382
to
fa89ff7
Compare
3fb7761
to
fa89ff7
Compare
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its looks good for me.
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Outdated
Show resolved
Hide resolved
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Outdated
Show resolved
Hide resolved
d17ec52
to
d9e200a
Compare
@AJadhav29 please take care of below points:
|
The system test was green. |
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Outdated
Show resolved
Hide resolved
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Outdated
Show resolved
Hide resolved
@AJadhav29 Could you please verify the values mentioned in the json file are getting applied correctly into the cluster where system test is ran. |
...src/main/java/io/pravega/test/system/framework/services/kubernetes/BookkeeperProperties.java
Outdated
Show resolved
Hide resolved
40428d9
to
c16a803
Compare
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Outdated
Show resolved
Hide resolved
6e92afa
to
d0e78f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do have a look to the comments @AJadhav29.
.put("options", props) | ||
.put("controllerResources", getResources(resourceWrapper.getControllerProperties().getControllerResources().getLimits().get("cpu"), | ||
resourceWrapper.getControllerProperties().getControllerResources().getLimits().get("memory"), | ||
resourceWrapper.getControllerProperties().getControllerResources().getRequests().get("cpu"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont pass cpu and memory just call get resources with empty parameter and do all stuff inside the getResources() method because resource Wrapper is present there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so that's feasible. The getResources() method in the AbstractService class has 4 parameters passed and couldn't be passed empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can refactor it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think refactoring would make any sense here. The only thing we can do then is to remove that method from AbstractService class and pass the value as we did for others.
...stem/src/main/java/io/pravega/test/system/framework/services/kubernetes/AbstractService.java
Outdated
Show resolved
Hide resolved
import java.util.Map; | ||
|
||
/** | ||
* POJO class for bookkeeperProperties. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please give some more context to the comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The POJO class itself lists the parameters that it wants to get from the json. I believe that explains the context :)
...src/main/java/io/pravega/test/system/framework/services/kubernetes/ControllerProperties.java
Show resolved
Hide resolved
test/system/src/main/java/io/pravega/test/system/framework/services/kubernetes/Probes.java
Show resolved
Hide resolved
test/system/src/main/java/io/pravega/test/system/framework/services/kubernetes/Storage.java
Show resolved
Hide resolved
.../src/main/java/io/pravega/test/system/framework/services/kubernetes/ZookeeperProperties.java
Show resolved
Hide resolved
.../src/main/java/io/pravega/test/system/framework/services/kubernetes/ZookeeperProperties.java
Show resolved
Hide resolved
test/system/src/main/java/io/pravega/test/system/framework/services/kubernetes/Storage.java
Show resolved
Hide resolved
...c/main/java/io/pravega/test/system/framework/services/kubernetes/SegmentStoreProperties.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do have a look to the comments @AJadhav29.
9e436e0
to
f3f8da7
Compare
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
f3f8da7
to
b75dbf6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
InputStream stream = ResourceWrapper.class.getClassLoader().getResourceAsStream(configFile); | ||
ResourceWrapper resourceWrapper = null; | ||
try { | ||
resourceWrapper = objectMapper.readValue(stream, ResourceWrapper.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might have to close the mapper or the underlying stream when done, on exception etc?
private static final String JOURNALDIRECTORIES = "/bk/journal/j0,/bk/journal/j1,/bk/journal/j2,/bk/journal/j3"; | ||
private static final String LEDGERDIRECTORIES = "/bk/ledgers/l0,/bk/ledgers/l1,/bk/ledgers/l2,/bk/ledgers/l3"; | ||
|
||
private static final String SYSTEMTESTCONFIG = "systemTestConfig.json"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to pass custom config now we edit this file and place it where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are placing the json config file in same package in resources folder -
The repository root for the config file is - test/system/src/test/resources/systemTestConfig.json.
But we are passing the sorce root instead for the config file.
private ZookeeperProperties zookeeperProperties; | ||
private Map<String, String> pravegaOptions; | ||
|
||
public static ResourceWrapper getSystemTestConfig(String configFile) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this used be to pass in a custom file path now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We are creating a static constant - SYSTEMTESTCONFIG in AbstractService class to pass the config file. Then we are passing that with another declared constant as - ResourceWrapper.getSystemTestConfig(SYSTEMTESTCONFIG).
.build()) | ||
.put("requests", ImmutableMap.builder() | ||
.put("cpu", requestsCpu) | ||
.put("memory", requestsMem) | ||
.put("cpu", resources.getRequests().get("cpu")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can choose to introduce static constants here and at other places.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are not more than 2 instances of resources.getRequests or resourceWrapper.getControllerProperties or any of the other properties. So, even then do we need to instroduce static constants for each of them?
Signed-off-by: AJadhav29 <aditi.jadhav@dell.com> Signed-off-by: AJadhav29 <aditi.jadhav@dell.com>
* POJO class for bookkeeperProperties. | ||
*/ | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use lombok + Jackson annotations to make these immutable
https://www.baeldung.com/jackson-deserialize-immutable-objects
https://projectlombok.org/features/Builder
* POJO class for controllerProperties. | ||
*/ | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
* POJO class for bookkeeper probes. | ||
*/ | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
*/ | ||
@Slf4j | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
* POJO class for getting resources for controller, segmentStore, zookeeper and bookkeeper. | ||
*/ | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
* POJO class for segmentStoreProperties. | ||
*/ | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
* POJO class for getting storage values for bookkeeperStorage. | ||
*/ | ||
@Getter | ||
@Setter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
Change log description
Currently, the Pravega ZK and BK configurations for system tests are read from the default config values.
Purpose of the change
Fixes #7072
What the code does
To read the pravega ZK and BK configuration option from an input jSON file for system tests.
Remove the hardcoded values and replace it to accept from json file.
How to verify it
The ZK and BK config values for system tests are read from external input json file when running system tests.