-
Notifications
You must be signed in to change notification settings - Fork 130
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
Add 'kn func emit' command #332
Conversation
|
||
cancel() // stop the client | ||
|
||
if got.Source() != "/boson/fn" { |
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.
What if we used github.com/stretchr/testify/assert
for prettier assertions?
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 like what assertion frameworks do in some languages, and have used several throughout the years, but (and I stress this is just a humble opinion), I have come to not like them. especially in Go. Having watched them steadily descend into madness repeatedly throughout the years, they are something I now avoid.
The standard built in language logic operators are are not only accessible to everyone without the need to learn a new API, but they also age better, and tend to teach the reader of the tests about the language, and the package being tested, better as one reads the tests. The code is being presented in a context similar to how it will be used in their code, rather than a somewhat contrived context of an almost, but not quite, natural language assertion syntax that is often just qirky enough to be confusing.
I am happy to go along with the majority opinion on this one, if others want to use an assertions framework I am game, but I feel compelled to make my jaded curmudgeon of a voice heard. I am also open to being educated on why they are worth the aforementioned problems!
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 am easy either way, but I don't think a new assertion library should be added in this PR. Willing to rebase on top of one that does though. :)
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.
Lookin' pretty good for a draft IMHO
4a77c29
to
128e420
Compare
741ce38
to
506774f
Compare
@boson-project/core I think this is ready for a review. PTAL. |
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.
Looking good! Minor nit on warning when both data and file is set.
This commit adds an Emitter to be used by the CLI commands for sending CloudEvents to functions, either locally, on the cluster, or at a specified endpoint. Signed-off-by: Lance Ball <lball@redhat.com>
7868604
to
2109669
Compare
// TODO: This made me wonder whether we should switch to a real logging library | ||
fmt.Printf("WARN: Found both --data and --file. Using file: %v\n", config.File) |
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.
@lance I would take the purist approach and say that there is no way this is a state the developer intended, but is due to either a misconfiguration or misunderstanding, and should thus be an error.
* fix: make socatImage linker setable * Make socatImage var linker setable * Remove socatImage override via envvar Signed-off-by: Matej Vasek <mvasek@redhat.com> * fixup: make socatImage public Signed-off-by: Matej Vasek <mvasek@redhat.com> Signed-off-by: Matej Vasek <mvasek@redhat.com>
Adds the
kn func emit
command. Usage is:Still needed:
Signed-off-by: Lance Ball lball@redhat.com