Gaffer icon indicating copy to clipboard operation
Gaffer copied to clipboard

Improve Federated Store Tests to make use of properties file

Open GCHQDeveloper314 opened this issue 1 year ago • 5 comments

Describe the enhancement you'd like Throughout the Federated Store there are multiple instances of this code pattern in many places in various files: https://github.com/gchq/Gaffer/blob/ac602892435bdd0180f783c80f774149f50eb7f0/store-implementation/federated-store/src/test/java/uk/gov/gchq/gaffer/federatedstore/FederatedStoreVisibilityTest.java#L71-L72

These can all be replaced with a single line which loads a generic Federated Store config properties file (from test/resources) using the getFederatedStorePropertiesWithHashMapCache utility method from FederatedStoreTestUtil.

Why do you want this feature? To simplify the tests for this module.

GCHQDeveloper314 avatar Feb 08 '24 16:02 GCHQDeveloper314

Hi, i want to work on this issue. Could you assign this issue?

nine03 avatar Mar 19 '24 12:03 nine03

Hello, to resolve this issue I forked the repository and cloned it locally using SourceTree. I opened the code related to the issue, but there seems to be an import error. I would appreciate any advice on how to address this. Please reply when you have time.

nine03 avatar Mar 19 '24 14:03 nine03

Depending on the IDE used, it might require you to run a full build locally first. You can do this with mvn clean install -Pquick. If you are using Windows then some tests may fail to run (Hadoop/Accumulo) as they are not compatible with Windows.

GCHQDeveloper314 avatar Mar 19 '24 15:03 GCHQDeveloper314

Thank you for the advice. I was able to build successfully using the mvn clean install -Pquick command you suggested. The problem is that when I tried to run the FederatedStoreVisibilityTest test code, it failed the tests as shown in the screenshot. I installed Ubuntu and ran the tests there, but I'm still getting the same results as shown in the image.

nine03 avatar Mar 20 '24 00:03 nine03

Ensure you have Java 8 installed and configured as the Java version to use in your IDE. I did some brief research which indicates that that zookeeper error is caused by using a recent Java version. Java 11 is the latest which is officially supported, but 8 is recommended for now.

GCHQDeveloper314 avatar Mar 20 '24 09:03 GCHQDeveloper314