Skip to content

test: use Fluent::Config::Element in test - #4074

Merged
ashie merged 1 commit into
fluent:masterfrom
abetomo:use-config_element-in-tests
Mar 7, 2023
Merged

test: use Fluent::Config::Element in test#4074
ashie merged 1 commit into
fluent:masterfrom
abetomo:use-config_element-in-tests

Conversation

@abetomo

@abetomo abetomo commented Feb 28, 2023

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:

( #4066 (comment) )

What this PR does / why we need it:

There is a case where Hash is used in the test of configure method.
I fixed it because configure method should use Fluent::Config::Element.

Docs Changes:

Release Note:

We should use `Fluent::Config::Element` instead of Hash.

Signed-off-by: abetomo <abe@enzou.tokyo>
@ashie

ashie commented Mar 3, 2023

Copy link
Copy Markdown
Member

Whether we should merge this or not depends on the discussion in #4066 (comment)

@daipom

daipom commented Mar 3, 2023

Copy link
Copy Markdown
Contributor

Sorry for the delay, yes I think so too.

I'm considering #4066's goal.
Please give me more time.

Comment thread test/test_formatter.rb
@ashie

ashie commented Mar 7, 2023

Copy link
Copy Markdown
Member

Whether we should merge this or not depends on the discussion in #4066 (comment)

Our conclusion in the discussion is #4066 (comment)

So, I think the correct specification is as follows.

* Only the `Fluent::Config::Element` should be passed to `Fluent::Plugin::Base::configure()`.

* All tests passing `Hash` directly to `Fluent::Plugin::Base::configure()` are wrong and must use `TestDriver`.

So we'll merge this.

@ashie
ashie merged commit c0125d8 into fluent:master Mar 7, 2023
@ashie

ashie commented Mar 7, 2023

Copy link
Copy Markdown
Member

Thanks!

Comment thread test/test_formatter.rb

def test_format
@formatter.configure({})
@formatter.configure(config_element())

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 the one we should use Fluent::Test::FormatterTestDriver for.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah, sorry I've already merged this although you are right...

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.

No problem! I'm making another PR for this now!

@ashie ashie added this to the v1.16.0 milestone Mar 7, 2023
@abetomo
abetomo deleted the use-config_element-in-tests branch March 7, 2023 01:28
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