meshery / meshery

Meshery, the cloud native manager
https://meshery.io
Apache License 2.0
5.66k stars 1.77k forks source link

[mesheryctl] mesheryctl needs new style test cases #7821

Open Aisuko opened 1 year ago

Aisuko commented 1 year ago

See mesheryctl Command Tracker for current status of commands.

Current Behavior

-- FAIL: TestAppList (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestOffboardCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestOnboardCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestAppView (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
FAIL
coverage: 2.9% of statements
FAIL    github.com/layer5io/meshery/mesheryctl/internal/cli/root/app    0.144s
ok      github.com/layer5io/meshery/mesheryctl/internal/cli/root/config 0.029s  coverage: 15.6% of statements
?       github.com/layer5io/meshery/mesheryctl/internal/cli/root/constants  [no test files]
?       github.com/layer5io/meshery/mesheryctl/internal/cli/root/experimental   [no test files]
--- FAIL: TestPatternList (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestPatternView (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
FAIL
coverage: 2.6% of statements
FAIL    github.com/layer5io/meshery/mesheryctl/internal/cli/root/filter 0.157s
?       github.com/layer5io/meshery/mesheryctl/internal/cli/root/mesh   [no test files]
--- FAIL: TestApplyCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestDeleteCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestPatternList (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestPatternView (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
FAIL
coverage: 2.7% of statements
FAIL    github.com/layer5io/meshery/mesheryctl/internal/cli/root/pattern    0.135s
--- FAIL: TestApplyCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
Error: unknown command "invalid" for "perf"
Run 'perf --help' for usage.
--- FAIL: TestProfileCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
--- FAIL: TestResultCmd (0.00s)
    testing.go:207: could not read file validate.version.github.golden: open /home/runner/work/meshery/meshery/mesheryctl/pkg/utils/fixtures/validate.version.github.golden: no such file or directory
FAIL

Desired Behavior

We need to remove the test cases which are related to golden files and use the simplest test framework testing for the new test cases. The new test cases should be simpler for the new contributors who are wanted to involve in the mesheryctl.

Screenshots/Logs

Environment


Contributor Guides and Handbook

github-actions[bot] commented 1 year ago

This issue has been labeled with 'component/mesheryctl'. Note that after making changes you need to update it in the mesheryctl command tracker spreadsheet.


        Be sure to join the community, if you haven't yet and please leave a :star: star on the project :smile:

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Aisuko commented 1 year ago

remove

EraKin575 commented 1 year ago

Is this issue still there? If yes, please assign me this

Aisuko commented 1 year ago

Hi @EraKin575 please take a look https://github.com/meshery/meshery/issues/7805. There are still two issues open.

EraKin575 commented 1 year ago

@Aisuko can you guide me to generate these test results so that I can identify where to make changes

Aisuko commented 1 year ago

Please join us on Slack channel, we can talk about it in more detail there. And @Philip-21 was working to this for a long time.

stale[bot] commented 11 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Aisuko commented 11 months ago

remove

stale[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Aisuko commented 10 months ago

remove

Aisuko commented 10 months ago

And we also need to avoid to use init function https://github.com/spf13/cobra/issues/1862

stale[bot] commented 8 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.