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

Fixes #24980 - enable structured formatters for refernces. #390

Merged
merged 1 commit into from Sep 26, 2018

Conversation

@rahulbajaj0509
Copy link
Member

rahulbajaj0509 commented Sep 25, 2018

No description provided.

@rahulbajaj0509

This comment has been minimized.

Copy link
Member Author

rahulbajaj0509 commented Sep 25, 2018

@mbacovsky hey, this pr makes sure we have correct output for json format, mind giving this a quick look?
@tstrachota thanks a ton for your help, wouldn't have been possible without you :)

@rahulbajaj0509

This comment has been minimized.

Copy link
Member Author

rahulbajaj0509 commented Sep 25, 2018

@mbacovsky for testing this pr, subsequent hammer changes can be found here theforeman/hammer-cli#288 :)

@mbacovsky mbacovsky self-requested a review Sep 25, 2018
Copy link
Member

mbacovsky left a comment

Thanks for the patches and tests. It looks almost ready to go. I found one little problem I don't understand. Could check it please?

options = {:name_key => :another_name}
formatter.format(reference_str_keys, options).must_equal 'SERVER'
formatter.format(reference_str_keys, options).must_equal("#{reference_str_keys['name']}")

This comment has been minimized.

Copy link
@mbacovsky

mbacovsky Sep 25, 2018

Member

reference_str_keys['another_name'] ?

This comment has been minimized.

Copy link
@mbacovsky

mbacovsky Sep 25, 2018

Member

Either I don't understand the test or something is wrong. If I "fix" the test it starts to fail. Any idea why?

This comment has been minimized.

Copy link
@tstrachota

tstrachota Sep 26, 2018

Member

IMHO the options are wrong in this test. Formatters don't accept :name_key but :display_field_key. See:

# :display_field_key - key where the formmatter will look for the main field to display, default is :name

This comment has been minimized.

Copy link
@mbacovsky

mbacovsky Sep 26, 2018

Member

I see now, thanks @tstrachota!

This comment has been minimized.

Copy link
@rahulbajaj0509

rahulbajaj0509 Sep 26, 2018

Author Member

Good catch @mbacovsky, sorry I somehow missed that. Thanks @tstrachota again :)

@rahulbajaj0509 rahulbajaj0509 force-pushed the rahulbajaj0509:fix-test-cases branch from adcc94f to 9009c56 Sep 26, 2018
Copy link
Member

mbacovsky left a comment

👍 Looks good now! Thanks @rahulbajaj0509, @tstrachota 🍨

@mbacovsky mbacovsky merged commit bf1cde1 into theforeman:master Sep 26, 2018
1 check passed
1 check passed
hammer Build finished. 3978 tests run, 0 skipped, 0 failed.
Details
@tstrachota

This comment has been minimized.

Copy link
Member

tstrachota commented Sep 26, 2018

Good job @rahulbajaj0509, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.