-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 a test extension dedicated to testing configuration #945
Conversation
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 behavior we want for non-Optional, non-List Object fields with no default value is usually (probably always) to initialize it to null
. I have most of a patch to fix that, which I can hopefully finish today.
Getting the test extension committed sooner is more important than fixing every problem that might arise from it, so if there are tests that fail, let's just @Ignore
them and open issues for each.
Ok, let me do some cleanup on this and then it can be merged. |
I guess it can be merged now. The test is disabled due to #959. |
Add fix for #978
Here is an initial stab at creating a test-extension in the core module. There are a couple of things I'm not sure of:
I'm validating the TestBuildTimeConfig and TestRunTimeConfig config roots in the TestTemplate#checkConfig build step. I was expecting that the TestRunTimeConfig fields would not have been set since it uses ConfigPhase.RUN_TIME. Currently that check is commented out since it fails. What am I missing here about how ConfigPhase.RUN_TIME behaves?
During the initialization phase of configuration, all config object fields are initialized to their given default or some type specific default. I have added a mapDefaultValue utility method to allow for the ObjectConfigType to provide a better choice than an empty string based on the fieldClass. This addresses the problem of Improve error reporting of missing default config values #891. I see Empty configuration values are passed to the converter #877 regarding empty string values passed to the converters. The question I have is why are we trying to initialize non-defaulted fields?