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

Add a test extension dedicated to testing configuration #945

Merged
merged 8 commits into from
Feb 21, 2019

Conversation

starksm64
Copy link
Contributor

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:

  1. 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?

  2. 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?

@starksm64 starksm64 requested a review from dmlloyd February 18, 2019 20:30
Copy link
Member

@dmlloyd dmlloyd left a 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.

@starksm64
Copy link
Contributor Author

Ok, let me do some cleanup on this and then it can be merged.

@starksm64
Copy link
Contributor Author

I guess it can be merged now. The test is disabled due to #959.

@starksm64
Copy link
Contributor Author

More improvement and added test to illustrate #962 and #956

@dmlloyd dmlloyd merged commit 4a61cb3 into quarkusio:master Feb 21, 2019
@gsmet gsmet changed the title Iss780, WIP, feedback needed Add a test extension dedicated to testing configuration Feb 21, 2019
@gsmet gsmet added this to the 0.10.0 milestone Feb 21, 2019
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.

3 participants