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

🏃 e2e: replace fmt.Println with writes to ginko's writer #3065

Merged
merged 1 commit into from
May 22, 2020

Conversation

cpanato
Copy link
Member

@cpanato cpanato commented May 14, 2020

What this PR does / why we need it:
replace fmt.Println with writes to ginko's writer

Let me know if this is what you want :)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

/cc @chuckha

@k8s-ci-robot k8s-ci-robot requested a review from chuckha May 14, 2020 16:41
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 14, 2020
@benmoss
Copy link

benmoss commented May 14, 2020

There's a bunch of calls to fmt.Fprintf that can be updated to use this too

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels May 15, 2020
Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

@cpanato thanks for this PR
I'm ok in getting rid of PrintLn to stdout, but I'm a little bit perplexed about the framework exposing a public Logf method. Is it possible to avoid this (e.g. move to an internal package)

. "github.com/onsi/ginkgo"
)

func Logf(format string, a ...interface{}) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm debated on exposing this as a public method, first because logging is tangential to the goal to the framework, second because in the long term the goal is to make the framework to work without ginkgo & gomega: see
#2306 (comment)
#2955

Copy link
Member Author

Choose a reason for hiding this comment

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

made the changes @fabianofranz let me know what do you think when you have time :)

@cpanato cpanato force-pushed the GH-2514 branch 3 times, most recently from 13226e7 to 08c17de Compare May 15, 2020 11:42
@@ -46,6 +46,10 @@ func Byf(format string, a ...interface{}) {
By(fmt.Sprintf(format, a...))
}

func Logf(format string, a ...interface{}) {

Choose a reason for hiding this comment

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

Can we use framework/internal/log everywhere?

Copy link
Member

Choose a reason for hiding this comment

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

@cpanato Any reason do we want to expose this as an API, or do we want to keep it internal?

Copy link
Member Author

Choose a reason for hiding this comment

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

@sedefsavas the on in framework is internal and only accessible in the framework and we cant access from the e2e tests package

Copy link
Member Author

@cpanato cpanato May 19, 2020

Choose a reason for hiding this comment

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

i can change that to be internal @vincepri , no reasons, i just follow the same approach i saw somewhere in k/k

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Please change this to private
(also here, logging is tangential to the goal of test/e2e and we don't want to expose methods for it)

Copy link
Member Author

Choose a reason for hiding this comment

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

done @fabriziopandini PTAL when you have time. thanks!

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 20, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 21, 2020
@benmoss
Copy link

benmoss commented May 21, 2020

/approve

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
thanks @cpanato

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 22, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: benmoss, cpanato, fabriziopandini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 22, 2020
@k8s-ci-robot k8s-ci-robot merged commit baedbb8 into kubernetes-sigs:master May 22, 2020
@cpanato cpanato deleted the GH-2514 branch May 22, 2020 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[e2e test framework] replace fmt.Println with writes to ginko's writer
6 participants