8000 Use flag set.Func() instead of custom type for -H by proooooogiba · Pull Request #999 · fortio/fortio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use flag set.Func() instead of custom type for -H #999

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

< 8000 /details-dialog>
Merged
merged 5 commits into from
Nov 23, 2024

Conversation

proooooogiba
Copy link
Contributor
@proooooogiba proooooogiba commented Nov 19, 2024

fix #993
fix #1000

Copy link
codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 42.85714% with 8 lines in your changes missing coverage. Please review.

Project coverage is 73.9%. Comparing base (8c89ef3) to head (f3dfe4a).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cli/fortio_main.go 27.3% 6 Missing and 2 partials ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           master    #999     +/-   ##
========================================
- Coverage    73.9%   73.9%   -0.1%     
========================================
  Files          25      25             
  Lines        6205    6200      -5     
========================================
- Hits         4587    4580      -7     
  Misses       1450    1450             
- Partials      168     170      +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member
@ldemailly ldemailly left a comment

Choose a reason for hiding this comment

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

Thanks ! there are more in fortio_main for the proxies too - can you change these too please?

and did you manually test to confirm it works the same?

@proooooogiba
Copy link
Contributor Author
  1. Replace at fortio_main custom type by Func
  2. I find implementation of flag.Func and under the hood it uses flag.Var, so i don't check it manually. Could you please say, what is the best way to check it manually? I thought, that cli_test will be enough.

@ldemailly
Copy link
Member

I don’t remember if I do have a test for multiple headers through CLI using the echo from debug.fortio.org for instance, maybe should add such txtar test if there isn’t. basically that multiple (and single) -H still works , ditto for proxies etc

@ldemailly
Copy link
Member

this does test the multiple -H https://github.com/fortio/fortio/blob/master/cli_test.txtar#L21

but for proxies not sure we have a test outside of https://github.com/fortio/fortio-demo-chart/blob/main/helm/fortio/templates/fortio.yaml#L205-L208 but that chart is used but not part of tests

@proooooogiba
Copy link
Contributor Author

this does test the multiple -H https://github.com/fortio/fortio/blob/master/cli_test.txtar#L21

but for proxies not sure we have a test outside of https://github.com/fortio/fortio-demo-chart/blob/main/helm/fortio/templates/fortio.yaml#L205-L208 but that chart is used but not part of tests

Add tests to cli_test.txtar file for the flags

@ldemailly
Copy link
Member

did a manual test to confirm

-M

09:45:07.309 r1 [INF] http_forwarder.go:317> Multi-server on [::]:5554 running with &{Targets:[{Destination:http://localhost:8080 MirrorOrigin:true} {Destination:http://localhost:8080 MirrorOrigin:true}] Serial:false Name:Multi on [::]:5554 client:0x140003e0d50}
09:45:07.309 r1 Fortio dev Multi on 5555 server listening on tcp [::]:5555
09:45:07.309 r1 [INF] http_forwarder.go:317> Multi-server on [::]:5555 running with &{Targets:[{Destination:http://localhost:8080 MirrorOrigin:true} {Destination:http://localhost:8080 MirrorOrigin:true}] Serial:false Name:Multi on [::]:5555 client:0x140003e0e70}

-P

09:45:55.830 r1 Fortio dev proxy for 127.0.0.1:8080 server listening on tcp [::]:5554
09:45:55.830 r1 Fortio dev proxy for 127.0.0.1:8080 server listening on tcp [::]:5555

@ldemailly ldemailly merged commit 2158d3e into fortio:master Nov 23, 2024
8 of 10 checks passed
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.

doc contributing part is deprecated use flag set.Func() instead of custom type for -H, perclist etc
2 participants
0