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

[#390] improve(test): Consistency check in the graviton.conf file #408

Merged
merged 2 commits into from
Sep 18, 2023
Merged

[#390] improve(test): Consistency check in the graviton.conf file #408

merged 2 commits into from
Sep 18, 2023

Conversation

xunliu
Copy link
Member

@xunliu xunliu commented Sep 18, 2023

What changes were proposed in this pull request?

  • Add ServerConfigTest to keep consistency check in the graviton.conf file.
  • Use the JAVA reflect method to get all property names from ServerConfig.java and Configs.java files.

Why are the changes needed?

Because property names in the graviton.conf.template file need to be kept consistent with com/datastrato/graviton/Configs.java and com/datastrato/graviton/server/ServerConfig.java,
Otherwise, Graviton will not be able to read graviton.conf file correctly.

Fix: #390

Does this PR introduce any user-facing change?

N/A

How was this patch tested?

Added ServerConfigTest in the test cases.

@github-actions
Copy link

Code Coverage Report

Overall Project 62.86% 🟢

There is no coverage information present for the Files changed

+ File.separator
+ "conf"
+ File.separator
+ "/graviton.conf.template";
Copy link
Contributor

Choose a reason for hiding this comment

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

Redundant slash '/' here

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I removed the extra file separator.

for (Map.Entry<Object, Object> entry : properties.entrySet()) {
String propKey = (String) entry.getKey();
Assertions.assertTrue(
configKeyMap.containsKey(propKey),
Copy link
Contributor

Choose a reason for hiding this comment

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

Here it looks like we will only check the configs that exist in the conf file, if not, the check logic will be passed, is that what we expected?

@jerryshao jerryshao merged commit 0d00735 into apache:main Sep 18, 2023
2 checks passed
@xunliu xunliu deleted the issue-390 branch December 12, 2023 06:52
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.

[Improvement] Property name consistency check in the graviton.conf.template file
3 participants