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

test: improve test coverage #88

Merged
merged 3 commits into from
May 4, 2023
Merged

Conversation

TJM
Copy link
Contributor

@TJM TJM commented Apr 26, 2023

Add a few error state tests to improve test coverage on config/rotate

  • path_config_rotate.go
    • master: 77.1% (overall 62.4%)
    • this branch: 88.6% (overall 65%)

@TJM TJM requested a review from alexhung as a code owner April 26, 2023 04:03
@TJM
Copy link
Contributor Author

TJM commented Apr 26, 2023

We have all the "positive" test cases covered, but I am not sure how to create some of the errors. If you have ideas, let me know. I am going to tackle /config/admin next.

@TJM TJM changed the title feat: improve path_config_rotate test coverage feat: improve test coverage Apr 26, 2023
@TJM
Copy link
Contributor Author

TJM commented Apr 26, 2023

  • path_config.go
    • master: 68.1% (62.4% overall)
    • this branch: 91.2% (68.2% overall)

@TJM
Copy link
Contributor Author

TJM commented Apr 26, 2023

Learned something...
Screenshot 2023-04-26 at 8 46 13 AM

We don't need this case statement to check for bool, because no matter what we submit, it comes out as a string? although this feels like a bug to me :)

@TJM TJM changed the title feat: improve test coverage test: improve test coverage Apr 26, 2023
path_config.go Show resolved Hide resolved
@alexhung
Copy link
Member

Learned something... Screenshot 2023-04-26 at 8 46 13 AM

We don't need this case statement to check for bool, because no matter what we submit, it comes out as a string? although this feels like a bug to me :)

Most likely because the attribute is defined as TypeString (https://github.com/jfrog/artifactory-secrets-plugin/blob/master/path_config.go#L33) 😄

Instead we should use TypeBool.

Copy link
Member

@alexhung alexhung left a comment

Choose a reason for hiding this comment

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

LGTM. Just the commented out line of code.

path_config_rotate_test.go Show resolved Hide resolved
@TJM
Copy link
Contributor Author

TJM commented May 4, 2023

Learned something... Screenshot 2023-04-26 at 8 46 13 AM
We don't need this case statement to check for bool, because no matter what we submit, it comes out as a string? although this feels like a bug to me :)

Most likely because the attribute is defined as TypeString (https://github.com/jfrog/artifactory-secrets-plugin/blob/master/path_config.go#L33) 😄

Instead we should use TypeBool.

Created a new issue for this.

@alexhung alexhung merged commit be6b789 into jfrog:master May 4, 2023
@TJM TJM deleted the feat/more-rotate-tests branch May 4, 2023 16:54
@alexhung alexhung added the enhancement New feature or request label May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants