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

feat: add support for struct and map fields #137

Merged
merged 5 commits into from
Feb 17, 2021

Conversation

piksel
Copy link
Member

@piksel piksel commented Feb 7, 2021

Adds additional configuration field types for service configs.
Ref #73

@codecov
Copy link

codecov bot commented Feb 7, 2021

Codecov Report

Merging #137 (6f2e6b0) into main (ce75958) will decrease coverage by 4.16%.
The diff coverage is 75.65%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
- Coverage   65.93%   61.77%   -4.17%     
==========================================
  Files          56       62       +6     
  Lines        1371     1758     +387     
==========================================
+ Hits          904     1086     +182     
- Misses        386      561     +175     
- Partials       81      111      +30     
Impacted Files Coverage Δ
pkg/format/format.go 0.00% <0.00%> (ø)
pkg/format/formatter.go 57.89% <76.99%> (ø)
pkg/format/enum_formatter.go 60.00% <0.00%> (ø)
pkg/format/prop_key_resolver.go 0.00% <0.00%> (ø)
pkg/format/format_colorize.go 0.00% <0.00%> (ø)
pkg/format/format_query.go 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ce75958...6f2e6b0. Read the comment docs.

@JonasPf
Copy link
Contributor

JonasPf commented Feb 16, 2021

I ran into some problems with using gingko to run the tests:

$ ginkgo -r

Summarizing 6 Failures:

[Fail] the format package SetConfigField when formatting stuct values when setting and formatting [It] should format signed integers identical to input
/Users/jonas/projects/blockdaemon/shoutrrr/pkg/format/format_test.go:236

[Fail] the format package SetConfigField when formatting stuct values when setting and formatting [It] should format unsigned integers identical to input
/Users/jonas/projects/blockdaemon/shoutrrr/pkg/format/format_test.go:236

[Fail] the format package SetConfigField when formatting stuct values when setting and formatting [It] should format enums identical to input
/Users/jonas/projects/blockdaemon/shoutrrr/pkg/format/format_test.go:236

[Fail] the format package SetConfigField when formatting stuct values when setting and formatting [It] should format string slices identical to input
/Users/jonas/projects/blockdaemon/shoutrrr/pkg/format/format_test.go:236

[Fail] the format package SetConfigField when formatting stuct values when setting and formatting [It] should format string arrays identical to input
/Users/jonas/projects/blockdaemon/shoutrrr/pkg/format/format_test.go:236

[Fail] the format package SetConfigField when formatting stuct values when setting and formatting [It] should format prop struct slices identical to input
/Users/jonas/projects/blockdaemon/shoutrrr/pkg/format/format_test.go:236

Curiously it works when I run them using go test ./... (same as the CI). Anything I'm doing wrong with ginkgo?

@piksel
Copy link
Member Author

piksel commented Feb 17, 2021

It's due to the color support. When running with go test it detects the output as not being a TTY and strips the color codes from the output, but this does not happen with ginkgo. I usually use go test to run, so I hadn't noticed this. I should update the tests to always strip the color information (since that is neither that important, nor what the tests are actually trying to verify here).

Expected
      <string>: \x1b[94m-45\x1b[0m
  to equal
      <string>: -45

@piksel piksel merged commit fd3e82d into main Feb 17, 2021
@piksel piksel deleted the feature/format-struct-map-fields branch February 17, 2021 11:34
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.

2 participants