Skip to content

MINOR: Fix potential bug in LogConfig.getConfigValue and improve test coverage#7159

Merged
ijuma merged 3 commits intoapache:trunkfrom
ijuma:log-config-to-html-test
Aug 4, 2019
Merged

MINOR: Fix potential bug in LogConfig.getConfigValue and improve test coverage#7159
ijuma merged 3 commits intoapache:trunkfrom
ijuma:log-config-to-html-test

Conversation

@ijuma
Copy link
Copy Markdown
Member

@ijuma ijuma commented Aug 3, 2019

LogConfig.getConfigValue would throw a NoSuchElementException if any log
config was defined without a server default mapping.

Added a unit test for getConfigValue and a sanity test for
toHtml/toRst/toEnrichedRst, which were previously not exercised during
the test suite.

Committer Checklist (excluded from commit message)

  • Verify design and implementation
  • Verify test coverage and CI build status
  • Verify documentation (including upgrade notes)

ijuma added 3 commits August 3, 2019 10:59
… coverage

LogConfig.getConfigValue would throw a NoSuchElementException if any log config
was defined without a server default mapping.

Added a unit test for `getConfigValue` and a sanity test for `toHtml`/`toRst`/`toEnrichedRst`, which were
previously not exercised during the test suite.
override def headers = List("Name", "Description", "Type", "Default", "Valid Values", ServerDefaultHeaderName,
"Importance").asJava

override def getConfigValue(key: ConfigKey, headerName: String): String = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if we can come up with a better name. I was having a hard time understanding this patch because this is named so generically. Maybe something like docStringForHeader or something like that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I agree that it's not a good name. I thought about renaming it too, but then decided to limit the scope. Happy to do it given your feedback.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess this is grey area as far as compatibility is concerned since ConfigKey is public. Let's go ahead and leave it for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

getConfigValue is defined in ConfigDef and it's protected. However, ConfigDef is designed to be inherited from, so it could be considered a compatibility break to rename it. I agree with you that it's best to leave it for now.

Copy link
Copy Markdown
Contributor

@hachikuji hachikuji left a comment

Choose a reason for hiding this comment

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

LGTM

@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Aug 4, 2019

retest this please

@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Aug 4, 2019

One of the builds succeeded and the two others failed due to unrelated flaky tests. Started another build just in case.

@jsancio
Copy link
Copy Markdown
Member

jsancio commented Aug 4, 2019

Thanks @ijuma. LGTM

@ijuma
Copy link
Copy Markdown
Member Author

ijuma commented Aug 4, 2019

Two builds succeeded (although one reported a failure, it actually passed) and one failed with known flake (kafka.server.DescribeLogDirsRequestTest.testDescribeLogDirsRequest). Merging to master.

@ijuma ijuma merged commit f70ece2 into apache:trunk Aug 4, 2019
@ijuma ijuma deleted the log-config-to-html-test branch August 4, 2019 07:00
ijuma added a commit to confluentinc/kafka that referenced this pull request Aug 4, 2019
… coverage (apache#7159)

LogConfig.getConfigValue would throw a NoSuchElementException if any log
config was defined without a server default mapping.

Added a unit test for `getConfigValue` and a sanity test for
`toHtml`/`toRst`/`toEnrichedRst`, which were previously not exercised during
the test suite.

Reviewers: Jason Gustafson <jason@confluent.io>, José Armando García Sancio <jsancio@users.noreply.github.com>
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