-
Notifications
You must be signed in to change notification settings - Fork 90
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
Test/add runtime manager tests #2175
base: main
Are you sure you want to change the base?
Conversation
218715f
to
ec0048d
Compare
da784fc
to
e0d5d1c
Compare
e0d5d1c
to
7f6d1bf
Compare
70302bd
to
1d3108f
Compare
1d3108f
to
6963fd4
Compare
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days. |
4daaeb0
to
fe8d2fc
Compare
I just added another commit update here: according to these: #1555 (comment) gentle ping for @kate-osborn , I can add more updates if required |
fe8d2fc
to
547e903
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2175 +/- ##
==========================================
+ Coverage 88.84% 89.26% +0.42%
==========================================
Files 100 100
Lines 7527 7535 +8
Branches 50 50
==========================================
+ Hits 6687 6726 +39
+ Misses 784 752 -32
- Partials 56 57 +1 ☔ View full report in Codecov by Sentry. |
1318e1b
to
2626ca2
Compare
2626ca2
to
8b94a05
Compare
latest updates are in this commit: 8b94a05 |
internal/mode/static/manager.go
Outdated
@@ -158,6 +161,7 @@ func StartManager(cfg config.Config) error { | |||
|
|||
var ngxPlusClient *ngxclient.NginxClient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miledxz can you change this type to nginxPlusClient interface defined in the nginx runtime package?
The functional tests fail because the function IsPlus on the nginx runtime manager returns true even when the nginxPlusClient is nil. This is due to a subtlety around interface types.
If you pass a nil *ngxclient.NginxClient
as the type nginxPlusClient
, it will not evaluate as nil. Take a look at this go playground example: https://goplay.tools/snippet/sDiRga5qSqm
We need to change this type to the interface nginxPlusClient type to fix this. This means you will need to export the nginxPlusClient interface and modify the collectors.NewNginxPlusMetricsCollector function to accept the interface instead of the actual client.
Apologies for not catching this sooner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miledxz there's a couple errors in the pipeline that need to be fixed:
cannot find package with target: nginxPlusClient
Writing `FakeNginxPlusClient` to `runtimefakes/fake_nginx_plus_client.go`... exit status 1
Error: internal/mode/static/metrics/collectors/nginx.go:33:3: cannot use plusClient (variable of type "github.com/nginxinc/nginx-gateway-fabric/internal/mode/static/nginx/runtime".NginxPlusClient) as *"github.com/nginxinc/nginx-plus-go-client/client".NginxClient value in argument to nginxCollector.NewNginxPlusCollector: need type assertion (typecheck)
Proposed changes
Reopening pr trough another pr because issues on github
update on this: #1555, since I did mistake and discarded all commits,
I haven't find better solution so I opened another pr @sjberman @kate-osborn
Release notes
If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.