-
Notifications
You must be signed in to change notification settings - Fork 886
chore: allow running fake idp with coderd dev #11555
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
Conversation
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.
Cool!
@@ -0,0 +1,58 @@ | |||
package main |
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.
This could be moved to cmd/testidp
. I think it would be confusing to have packages that can be built sprinkled within the source tree.
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.
Good call 👍
Name: "Run Fake IDP", | ||
F: RunIDP(), | ||
}, | ||
}, nil, nil) |
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.
This feels weird, but I understand you did it to use the oidctest
package 😄, it's also possible to build a test package, typically I'd suggest to implement this that way, but it wouldn't be as easily discoverable as this is (esp. if put in cmd/
).
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.
I felt werid saying run go test -run="TestRealIDP"
or something.
Another idea I had was to just implement the testing.TB
struct myself and just throw log messages on the Fails(). It's not as trivial as I'd hope though, they have this: https://github.com/golang/go/blob/master/src/testing/testing.go#L899-L902
So I'd have to embed an actual testing.T struct? It just also has it's "jankiness", so just went with this for now.
This could be made more ergonomic, but this is a good start.
Essentially as I debug this oauth stuff, the
oidctest
stuff has been excellent for testing, and I think it would be valuable to also be able to manually test the UI with it. For example this: #11554 hangs indefinitely on the UI. I got this accidentally from github, but it would be nice to manually invoke this.Maybe the e2e tests could use this too? idk.
Example
Run this file
Then copy that flag to
develop.sh
Flag parsing
I fixed that awhile ago here: #11268