Skip to content

refactor scorecard to be more testable#3287

Merged
jmccormick2001 merged 1 commit intooperator-framework:masterfrom
jberkhahn:refactor_scorecard
Jun 30, 2020
Merged

refactor scorecard to be more testable#3287
jmccormick2001 merged 1 commit intooperator-framework:masterfrom
jberkhahn:refactor_scorecard

Conversation

@jberkhahn
Copy link
Copy Markdown
Contributor

Description of the change:
This refactors the alpha scorecard cmd to be more easily testable by making a command struct to contain the various fields, and moving the arg validation into a validate method, and the execution into a run method.

Motivation for the change:
As per #3246 I'm going through the commands that will survive the KB integration and adding unit tests for the cmd layer. It is difficult to write unit tests for commands with global vars and where the execution of the command is declared in-line in the cobra command declaration.

@estroz
Copy link
Copy Markdown
Member

estroz commented Jun 24, 2020

/cc @jmccormick2001 @varshaprasad96

@jberkhahn jberkhahn force-pushed the refactor_scorecard branch 4 times, most recently from e1873ef to 83b5e43 Compare June 24, 2020 22:59
@jberkhahn jberkhahn force-pushed the refactor_scorecard branch from 83b5e43 to 5759765 Compare June 24, 2020 23:04
@jmccormick2001 jmccormick2001 merged commit 54e3152 into operator-framework:master Jun 30, 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.

4 participants