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

Add a tail parameter to pod collector. #220

Merged
merged 4 commits into from
Oct 9, 2020
Merged

Add a tail parameter to pod collector. #220

merged 4 commits into from
Oct 9, 2020

Conversation

porridge
Copy link
Member

@porridge porridge commented Oct 7, 2020

What this PR does / why we need it:

Ability to set the number of lines to collect.
Also minor improvements to contributor guide.

Fixes #216

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

love it! thanks!

the project has a dependency on testify... could you switch out the newly added dependency.. then we are good!

pkg/apis/testharness/v1beta1/collector_test.go Outdated Show resolved Hide resolved
@kensipe
Copy link
Member

kensipe commented Oct 8, 2020

briefly looked into this... I see you are getting DeepEqual... is there a way to do this with our current tooling?

@kensipe
Copy link
Member

kensipe commented Oct 8, 2020

value of DeepEquals

=== RUN   TestPodCommand/pod_name_with_set_tail
    collector_test.go:157: assertion failed: 
        --- cmd.Command
        +++ tt.cmd
          strings.Join({
          	"kubectl logs --prefix foo -n $NAMESPACE --all-containers --tail=",
          	"4",
        - 	"2",
        + 	"3",
          }, "")
        
--- FAIL: TestPodCommand (0.00s)

value of testify .Equal

=== RUN   TestPodCommand/pod_name_with_set_tail
    collector_test.go:157: 
        	Error Trace:	collector_test.go:157
        	Error:      	Not equal: 
        	            	expected: "kubectl logs --prefix foo -n $NAMESPACE --all-containers --tail=42"
        	            	actual  : "kubectl logs --prefix foo -n $NAMESPACE --all-containers --tail=43"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-kubectl logs --prefix foo -n $NAMESPACE --all-containers --tail=42
        	            	+kubectl logs --prefix foo -n $NAMESPACE --all-containers --tail=43
        	Test:       	TestPodCommand/pod_name_with_set_tail
--- FAIL: TestPodCommand (0.00s)

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
- rather than linking to largely irrelevant `kudo`s testing guide, just
mention make targets and the testify library
- change the build command to one which actually builds, and remove
mention of manager :-)
- merge the `Testing new CLI` section into the `Build Instructions` one
to avoid duplication

Signed-off-by: Marcin Owsiany <mowsiany@D2iQ.com>
@porridge
Copy link
Member Author

porridge commented Oct 9, 2020

@kensipe I switched to testify and mentioned it in the contributor guide along with a couple other minor improvements there, PTAL.

Copy link
Member

@kensipe kensipe left a comment

Choose a reason for hiding this comment

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

fantastic! nice work!

@kensipe kensipe merged commit ab76b76 into main Oct 9, 2020
@kensipe kensipe deleted the porridge/tail branch October 9, 2020 14:22
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.

Allow specifying number of lines for pod test collector
2 participants