openfaas / openfaas/faas-cli

pkg commands: creates a function newXCmd() in charge of creating a new command

Open
#295 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

design/review proposal
Dominant language
Go
Stars
816
Forks
230
Avg merge
6h 4m
Merged PRs (30d)
1

Description

In some test cases, we need to reset flags & args of the command in test. In the actual used technique, creating the command in global scope and initializes its flags & args in init(), we cannot re-create the command to test it from state-zero.

If there is a testing technique for this case, please enlighten me :-)

Attempt to address this issue: https://github.com/openfaas/faas-cli/compare/master...itscaro:refactor-cmd

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the pkg command implementations and the proposed refactor comparison linked in the issue. Identify how commands, flags, and arguments are currently initialized, then verify that each command can be created from a clean state for the existing test cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.