Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Cli testing #869

Merged
merged 1 commit into from
Dec 2, 2022
Merged

Cli testing #869

merged 1 commit into from
Dec 2, 2022

Conversation

jsilverio22
Copy link
Contributor

@jsilverio22 jsilverio22 commented Nov 14, 2022

Issue: #868

@jsilverio22 jsilverio22 self-assigned this Nov 14, 2022
@jsilverio22 jsilverio22 changed the title Cli test Cli testing and acorn rm refactor Nov 15, 2022
@jsilverio22 jsilverio22 marked this pull request as ready for review November 15, 2022 20:47
@jsilverio22 jsilverio22 force-pushed the cli-test branch 2 times, most recently from 390ca00 to a28079f Compare November 17, 2022 16:32
@jsilverio22 jsilverio22 changed the title Cli testing and acorn rm refactor Cli testing Nov 17, 2022
Copy link
Contributor

@tylerslaton tylerslaton left a comment

Choose a reason for hiding this comment

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

Awesome work. I left some comments for my first pass. I'll come back through and mainly take a look at the MockClient since I didn't have time for it this morning.

pkg/cli/acorn.go Outdated Show resolved Hide resolved
pkg/cli/acorn_test.go Show resolved Hide resolved
pkg/cli/acorn_test.go Outdated Show resolved Hide resolved
client: &testdata.MockClient{},
},
wantErr: false,
wantOut: "Acorn: Containerized Application Packaging Framework\n\nUsage:\n acorn [flags]\n acorn [command]\n\nAvailable Commands:\n all List (almost) all objects\n app List or get apps\n build Build an app from a Acornfile file\n check Check if the cluster is ready for Acorn\n container Manage containers\n credential Manage registry credentials\n exec Run a command in a container\n help Help about any command\n image Manage images\n info Info about acorn installation\n install Install and configure acorn in the cluster\n login Add registry credentials\n logout Remove registry credentials\n logs Log all pods from app\n pull Pull an image from a remote registry\n push Push an image to a remote registry\n render Evaluate and display an Acornfile with args\n rm Delete an app, container, secret or volume\n run Run an app from an image or Acornfile\n secret Manage secrets\n start Start an app\n stop Stop an app\n tag Tag an image\n uninstall Uninstall acorn and associated resources\n update Update a deployed app\n volume Manage volumes\n wait Wait an app to be ready then exit with status code 0\n\nFlags:\n -A, --all-namespaces Namespace to work in\n --context string Context to use in the kubeconfig file\n --debug Enable debug logging\n --debug-level int Debug log level (valid 0-9) (default 7)\n -h, --help help for acorn\n --kubeconfig string Location of a kubeconfig file\n --namespace string Namespace to work in (default \"acorn\")\n\nUse \"acorn [command] --help\" for more information about a command.\n",
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we swap this to be ``` instead? That would make it a bit more natural to read for the future. If we want to cut down on lines, we could alternatively look at creating a testdata dir like some of the other tests have. Inside of that we could have a sub-directory called `acorn` and in that we could have a file of expect output for each of these tests.

Doing either of those things should make it less of a hassle when adding new tests that have expected console output since we won't need to add any formatting characters.

pkg/cli/acorn_test.go Outdated Show resolved Hide resolved
pkg/cli/run_test.go Outdated Show resolved Hide resolved
pkg/cli/all_test.go Outdated Show resolved Hide resolved
pkg/cli/images_test.go Outdated Show resolved Hide resolved
pkg/cli/log_test.go Show resolved Hide resolved
commandContext client.CommandContext
}{
{
name: "acorn render .", fields: fields{
Copy link
Contributor

Choose a reason for hiding this comment

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

We should test the happy path for this as well.

Copy link
Member

@cjellick cjellick left a comment

Choose a reason for hiding this comment

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

just need the conflict resolved

Signed-off-by: Joshua Silverio <joshua@acorn.io>
Copy link
Contributor

@tylerslaton tylerslaton left a comment

Choose a reason for hiding this comment

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

Awesome work @jsilverio22

@cjellick cjellick merged commit a09cd65 into acorn-io:main Dec 2, 2022
@jsilverio22 jsilverio22 deleted the cli-test branch December 5, 2022 15:42
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants