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

feat: pause duration as string with time unit #423

Merged
merged 3 commits into from
Mar 4, 2020

Conversation

cronik
Copy link
Contributor

@cronik cronik commented Mar 1, 2020

Support declaring pause duration as string with optional time
unit (i.e. "s", "m", "h"). If no time unit or value is an integer,
seconds are inferred.

closes #292

Support declaring pause duration as string with optional time
unit (i.e. "s", "m", "h"). If no time unit or value is an integer,
seconds are inferred.

closes argoproj#292
@codecov
Copy link

codecov bot commented Mar 1, 2020

Codecov Report

Merging #423 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #423   +/-   ##
======================================
  Coverage    84.5%   84.5%           
======================================
  Files          70      70           
  Lines        6667    6667           
======================================
  Hits         5634    5634           
  Misses        746     746           
  Partials      287     287
Impacted Files Coverage Δ
rollout/canary.go 86.23% <100%> (ø) ⬆️
rollout/pause.go 100% <100%> (ø) ⬆️
utils/conditions/conditions.go 88.95% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 57134f7...8402c0d. Read the comment docs.

// special case where no unit was specified
return int32(s)
}
return int32(p.Duration.IntVal)

Choose a reason for hiding this comment

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

unnecessary conversion (from unconvert)

@dthomson25
Copy link
Member

Overall, I think this looks great! I like the test in types.go, but I don't like how it brings our code coverage down by 30 percent since the autogenerated code is now being included. I think we can get around this by changing our test target in the Makefile to run two go test commands. The first command only runs the tests for v1alpha without coverage, and the second command runs all the other tests with coverage

@cronik
Copy link
Contributor Author

cronik commented Mar 4, 2020

I haven't used codecov.io before but it looks like they support an ignore paths configuration which could be another option if it does what it sounds like.

https://docs.codecov.io/docs/ignoring-paths

# .codecov.yml
ignore:
  - "pkg/apis/rollouts/v1alpha1"

I did play around with modifying the test command to exclude v1alpha with the following:

.PHONY: test
test: test-kustomize
	go test -failfast -covermode=count -coverprofile=coverage.out -coverpkg $(shell go list ./... | grep -v github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1 | xargs | tr ' ' ',') ${TEST_TARGET}

It works but the console output is not ideal (it prints the huge package list multiple times).

Maybe if the covecov config does not work I could just move types_test.go to a different package?

@dthomson25
Copy link
Member

I definitely think adding ignore field to the .codedev.yaml is the ideal solution. Can you try adding it and seeing if that changes the coverage? If not, I'll open a separate PR to fix this.

@cronik
Copy link
Contributor Author

cronik commented Mar 4, 2020

Looks like the codecov config worked!

Copy link
Member

@dthomson25 dthomson25 left a comment

Choose a reason for hiding this comment

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

LGTM! Please let me know if you have any other changes otherwise I'll merge it in!

@cronik
Copy link
Contributor Author

cronik commented Mar 4, 2020

I'm good, thanks!

@dthomson25 dthomson25 merged commit 8aafaed into argoproj:master Mar 4, 2020
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.

Make Pause duration use a string (5s) instead of int
3 participants