diff --git a/pkg/api/kpm_run_test.go b/pkg/api/kpm_run_test.go index 58e2f53b..3cd7ad6a 100644 --- a/pkg/api/kpm_run_test.go +++ b/pkg/api/kpm_run_test.go @@ -60,7 +60,7 @@ func TestRunPkgInPathInvalidPath(t *testing.T) { opts.SetPkgPath(filepath.Join(pkgPath, "test_kcl")) result, err := RunPkgInPath(opts) assert.NotEqual(t, err, nil) - assert.Equal(t, err.Error(), fmt.Sprintf("kpm: failed to compile the kcl package\nkpm: Cannot find the kcl file, please check the file path %s\n", filepath.Join(pkgPath, "test_kcl", "not_exist.k"))) + assert.Equal(t, err.Error(), fmt.Sprintf("error: failed to compile the kcl package\nerror: Cannot find the kcl file, please check the file path %s\n", filepath.Join(pkgPath, "test_kcl", "not_exist.k"))) assert.Equal(t, result, "") } @@ -71,7 +71,7 @@ func TestRunPkgInPathInvalidPkg(t *testing.T) { opts.Merge(kcl.WithKFilenames(filepath.Join(pkgPath, "invalid_pkg", "not_exist.k"))) result, err := RunPkgInPath(opts) assert.NotEqual(t, err, nil) - assert.Equal(t, true, strings.Contains(err.Error(), fmt.Sprintf("kpm: could not load 'kcl.mod' in '%s'\n", pkgPath))) + assert.Equal(t, true, strings.Contains(err.Error(), fmt.Sprintf("could not load 'kcl.mod' in '%s'\n", pkgPath))) assert.Equal(t, result, "") } diff --git a/pkg/client/client.go b/pkg/client/client.go index 4de108cd..80ca68a6 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -164,11 +164,8 @@ func (c *KpmClient) ResolvePkgDepsMetadata(kclPkg *pkg.KclPkg, update bool) erro // clean the dependencies in kcl.mod.lock which not in kcl.mod for name := range kclPkg.Dependencies.Deps { if _, ok := kclPkg.ModFile.Dependencies.Deps[name]; !ok { - reporter.ReportEventTo( - reporter.NewEvent( - reporter.RemoveDep, - fmt.Sprintf("removing '%s'", name), - ), + reporter.ReportMsgTo( + fmt.Sprintf("removing '%s'", name), c.logWriter, ) delete(kclPkg.Dependencies.Deps, name) @@ -177,11 +174,8 @@ func (c *KpmClient) ResolvePkgDepsMetadata(kclPkg *pkg.KclPkg, update bool) erro // add the dependencies in kcl.mod which not in kcl.mod.lock for name, d := range kclPkg.ModFile.Dependencies.Deps { if _, ok := kclPkg.Dependencies.Deps[name]; !ok { - reporter.ReportEventTo( - reporter.NewEvent( - reporter.AddDep, - fmt.Sprintf("adding '%s'", name), - ), + reporter.ReportMsgTo( + fmt.Sprintf("adding '%s'", name), c.logWriter, ) kclPkg.Dependencies.Deps[name] = d @@ -446,7 +440,7 @@ func (c *KpmClient) CompileOciPkg(ociSource, version string, opts *opt.CompileOp // createIfNotExist will create a file if it does not exist. func (c *KpmClient) createIfNotExist(filepath string, storeFunc func() error) error { - reporter.ReportMsgTo(fmt.Sprintf("kpm: creating new :%s", filepath), c.GetLogWriter()) + reporter.ReportMsgTo(fmt.Sprintf("creating new :%s", filepath), c.GetLogWriter()) err := utils.CreateFileIfNotExist( filepath, storeFunc, @@ -456,7 +450,7 @@ func (c *KpmClient) createIfNotExist(filepath string, storeFunc func() error) er if errEvent.Type() != reporter.FileExists { return err } else { - reporter.ReportMsgTo(fmt.Sprintf("kpm: '%s' already exists", filepath), c.GetLogWriter()) + reporter.ReportMsgTo(fmt.Sprintf("'%s' already exists", filepath), c.GetLogWriter()) } } else { return err @@ -494,8 +488,8 @@ func (c *KpmClient) AddDepWithOpts(kclPkg *pkg.KclPkg, opt *opt.AddOptions) (*pk return nil, err } - reporter.ReportEventTo( - reporter.NewEvent(reporter.Adding, fmt.Sprintf("adding dependency '%s'.", d.Name)), + reporter.ReportMsgTo( + fmt.Sprintf("adding dependency '%s'", d.Name), c.logWriter, ) // 2. download the dependency to the local path. @@ -515,11 +509,8 @@ func (c *KpmClient) AddDepWithOpts(kclPkg *pkg.KclPkg, opt *opt.AddOptions) (*pk succeedMsgInfo = fmt.Sprintf("%s:%s", d.Name, d.Version) } - reporter.ReportEventTo( - reporter.NewEvent( - reporter.Adding, - fmt.Sprintf("add dependency '%s' successfully.", succeedMsgInfo), - ), + reporter.ReportMsgTo( + fmt.Sprintf("add dependency '%s' successfully", succeedMsgInfo), c.logWriter, ) return kclPkg, nil @@ -564,7 +555,7 @@ func (c *KpmClient) PackagePkg(kclPkg *pkg.KclPkg, vendorMode bool) (string, err err = c.Package(kclPkg, kclPkg.DefaultTarPath(), vendorMode) if err != nil { - reporter.ExitWithReport("kpm: failed to package pkg " + kclPkg.GetPkgName() + ".") + reporter.ExitWithReport("failed to package pkg " + kclPkg.GetPkgName() + ".") return "", err } return kclPkg.DefaultTarPath(), nil @@ -751,11 +742,8 @@ func (c *KpmClient) Download(dep *pkg.Dependency, localPath string) (*pkg.Depend // DownloadFromGit will download the dependency from the git repository. func (c *KpmClient) DownloadFromGit(dep *pkg.Git, localPath string) (string, error) { - reporter.ReportEventTo( - reporter.NewEvent( - reporter.DownloadingFromGit, - fmt.Sprintf("downloading '%s' with tag '%s'.", dep.Url, dep.Tag), - ), + reporter.ReportMsgTo( + fmt.Sprintf("downloading '%s' with tag '%s'", dep.Url, dep.Tag), c.logWriter, ) @@ -787,8 +775,8 @@ func (c *KpmClient) DownloadFromOci(dep *pkg.Oci, localPath string) (string, err return "", err } - reporter.ReportEventTo( - reporter.NewEvent(reporter.SelectLatestVersion, "the lastest version '", tagSelected, "' will be added."), + reporter.ReportMsgTo( + fmt.Sprintf("the lastest version '%s' will be added", tagSelected), c.logWriter, ) @@ -798,11 +786,8 @@ func (c *KpmClient) DownloadFromOci(dep *pkg.Oci, localPath string) (string, err tagSelected = dep.Tag } - reporter.ReportEventTo( - reporter.NewEvent( - reporter.DownloadingFromOCI, - fmt.Sprintf("downloading '%s:%s' from '%s/%s:%s'.", dep.Repo, tagSelected, dep.Reg, dep.Repo, tagSelected), - ), + reporter.ReportMsgTo( + fmt.Sprintf("downloading '%s:%s' from '%s/%s:%s'", dep.Repo, tagSelected, dep.Reg, dep.Repo, tagSelected), c.logWriter, ) @@ -864,24 +849,18 @@ func (c *KpmClient) PullFromOci(localPath, source, tag string) error { return reporter.NewErrorEvent( reporter.UnKnownPullWhat, errors.FailedPull, - "oci url or package name must be specified.", + "oci url or package name must be specified", ) } if len(tag) == 0 { - reporter.ReportEventTo( - reporter.NewEvent( - reporter.PullingStarted, - fmt.Sprintf("start to pull '%s'.", source), - ), + reporter.ReportMsgTo( + fmt.Sprintf("start to pull '%s'", source), c.logWriter, ) } else { - reporter.ReportEventTo( - reporter.NewEvent( - reporter.PullingStarted, - fmt.Sprintf("start to pull '%s' with tag '%s'.", source, tag), - ), + reporter.ReportMsgTo( + fmt.Sprintf("start to pull '%s' with tag '%s'", source, tag), c.logWriter, ) } @@ -930,8 +909,8 @@ func (c *KpmClient) PullFromOci(localPath, source, tag string) error { ) } - reporter.ReportEventTo( - reporter.NewEvent(reporter.PullingFinished, fmt.Sprintf("pulled '%s' in '%s' successfully.", source, storagePath)), + reporter.ReportMsgTo( + fmt.Sprintf("pulled '%s' in '%s' successfully", source, storagePath), c.logWriter, ) return nil @@ -1130,8 +1109,8 @@ func (c *KpmClient) pullTarFromOci(localPath string, ociOpts *opt.OciOptions) er if err != nil { return err } - reporter.ReportEventTo( - reporter.NewEvent(reporter.SelectLatestVersion, "the lastest version '", tagSelected, "' will be pulled."), + reporter.ReportMsgTo( + fmt.Sprintf("the lastest version '%s' will be pulled", tagSelected), c.logWriter, ) } else { @@ -1139,11 +1118,8 @@ func (c *KpmClient) pullTarFromOci(localPath string, ociOpts *opt.OciOptions) er } full_repo := utils.JoinPath(ociOpts.Reg, ociOpts.Repo) - reporter.ReportEventTo( - reporter.NewEvent( - reporter.Pulling, - fmt.Sprintf("pulling '%s:%s' from '%s'.", ociOpts.Repo, tagSelected, full_repo), - ), + reporter.ReportMsgTo( + fmt.Sprintf("pulling '%s:%s' from '%s'", ociOpts.Repo, tagSelected, full_repo), c.logWriter, ) diff --git a/pkg/cmd/cmd_import.go b/pkg/cmd/cmd_import.go index 8f9e39d1..b359966d 100644 --- a/pkg/cmd/cmd_import.go +++ b/pkg/cmd/cmd_import.go @@ -49,7 +49,7 @@ func NewImportCmd(kpmcli *client.KpmClient) *cli.Command { }, Action: func(c *cli.Context) error { if c.Args().Len() != 1 { - return fmt.Errorf("kpm: invalid arguments") + return fmt.Errorf("invalid arguments") } inputFile := c.Args().First() @@ -68,17 +68,17 @@ func NewImportCmd(kpmcli *client.KpmClient) *cli.Command { case "auto": opt.Mode = gen.ModeAuto default: - return fmt.Errorf("kpm: invalid mode: %s", c.String("mode")) + return fmt.Errorf("invalid mode: %s", c.String("mode")) } outputFile := c.String("output") if outputFile == "" { outputFile = "generated.k" - reporter.ReportMsgTo("kpm: output file not specified, use default: generated.k", kpmcli.GetLogWriter()) + reporter.ReportMsgTo("output file not specified, use default: generated.k", kpmcli.GetLogWriter()) } if _, err := os.Stat(outputFile); err == nil && !c.Bool("force") { - return fmt.Errorf("kpm: output file already exist, use --force to overwrite: %s", outputFile) + return fmt.Errorf("output file already exist, use --force to overwrite: %s", outputFile) } outputWriter, err := os.Create(outputFile) diff --git a/pkg/cmd/cmd_init.go b/pkg/cmd/cmd_init.go index 4251147c..1d5154f3 100644 --- a/pkg/cmd/cmd_init.go +++ b/pkg/cmd/cmd_init.go @@ -73,7 +73,7 @@ func NewInitCmd(kpmcli *client.KpmClient) *cli.Command { return err } - reporter.ReportMsgTo(fmt.Sprintf("kpm: package '%s' init finished", pkgName), kpmcli.GetLogWriter()) + reporter.ReportMsgTo(fmt.Sprintf("package '%s' init finished", pkgName), kpmcli.GetLogWriter()) return nil }, } diff --git a/pkg/cmd/cmd_login.go b/pkg/cmd/cmd_login.go index 849e4d7b..9c221db4 100644 --- a/pkg/cmd/cmd_login.go +++ b/pkg/cmd/cmd_login.go @@ -36,7 +36,6 @@ func NewLoginCmd(kpmcli *client.KpmClient) *cli.Command { return reporter.NewErrorEvent( reporter.InvalidCmd, fmt.Errorf("registry must be specified"), - "run 'kpm login help' for more information", ) } registry := c.Args().First() diff --git a/pkg/cmd/cmd_logout.go b/pkg/cmd/cmd_logout.go index 23aece52..bd0d4074 100644 --- a/pkg/cmd/cmd_logout.go +++ b/pkg/cmd/cmd_logout.go @@ -21,14 +21,13 @@ func NewLogoutCmd(kpmcli *client.KpmClient) *cli.Command { return reporter.NewErrorEvent( reporter.InvalidCmd, fmt.Errorf("registry must be specified"), - "run 'kpm logout help' for more information", ) } err := kpmcli.LogoutOci(c.Args().First()) if err != nil { return err } - reporter.ReportMsgTo("kpm: Logout Succeeded", kpmcli.GetLogWriter()) + reporter.ReportMsgTo("Logout Succeeded", kpmcli.GetLogWriter()) return nil }, } diff --git a/pkg/cmd/cmd_pkg.go b/pkg/cmd/cmd_pkg.go index 23534fc0..ee3858a2 100644 --- a/pkg/cmd/cmd_pkg.go +++ b/pkg/cmd/cmd_pkg.go @@ -40,7 +40,6 @@ func NewPkgCmd(kpmcli *client.KpmClient) *cli.Command { return reporter.NewErrorEvent( reporter.InvalidCmd, fmt.Errorf("the directory where the tar is generated is required"), - "run 'kpm pkg help' for more information", ) } @@ -53,7 +52,7 @@ func NewPkgCmd(kpmcli *client.KpmClient) *cli.Command { kclPkg, err := pkg.LoadKclPkg(pwd) if err != nil { - reporter.ExitWithReport("kpm: failed to load package in " + pwd + ".") + reporter.ExitWithReport("failed to load package in " + pwd + ".") return err } diff --git a/pkg/cmd/cmd_push.go b/pkg/cmd/cmd_push.go index bf3bc6b6..fb829012 100644 --- a/pkg/cmd/cmd_push.go +++ b/pkg/cmd/cmd_push.go @@ -164,7 +164,7 @@ func pushPackage(ociUrl string, kclPkg *pkg.KclPkg, vendorMode bool, kpmcli *cli return reporter.NewErrorEvent( reporter.UnsupportOciUrlScheme, errors.InvalidOciUrl, - "only support url scheme 'oci://'.", + "only support url scheme 'oci://'", ) } @@ -173,7 +173,7 @@ func pushPackage(ociUrl string, kclPkg *pkg.KclPkg, vendorMode bool, kpmcli *cli return err } - reporter.ReportMsgTo(fmt.Sprintf("kpm: package '%s' will be pushed", kclPkg.GetPkgName()), kpmcli.GetLogWriter()) + reporter.ReportMsgTo(fmt.Sprintf("package '%s' will be pushed", kclPkg.GetPkgName()), kpmcli.GetLogWriter()) // 4. Push it. err = kpmcli.PushToOci(tarPath, ociOpts) if err != (*reporter.KpmEvent)(nil) { diff --git a/pkg/errors/errors.go b/pkg/errors/errors.go index d7ae921e..5ae56535 100644 --- a/pkg/errors/errors.go +++ b/pkg/errors/errors.go @@ -4,54 +4,54 @@ import ( "errors" ) -var FailedDownloadError = errors.New("kpm: failed to download dependency") +var FailedDownloadError = errors.New("failed to download dependency") var CheckSumMismatchError = errors.New("checksum mismatch") -var FailedToVendorDependency = errors.New("kpm: failed to vendor dependency") -var FailedToPackage = errors.New("kpm: failed to package.") -var InvalidDependency = errors.New("kpm: invalid dependency.") -var InternalBug = errors.New("kpm: internal bug, please contact us and we will fix the problem.") -var FailedToLoadPackage = errors.New("kpm: failed to load package, please check the package path is valid.") +var FailedToVendorDependency = errors.New("failed to vendor dependency") +var FailedToPackage = errors.New("failed to package.") +var InvalidDependency = errors.New("invalid dependency.") +var InternalBug = errors.New("internal bug, please contact us and we will fix the problem.") +var FailedToLoadPackage = errors.New("failed to load package, please check the package path is valid.") // Invalid Options Format Errors // Invalid 'kpm init' -var InvalidInitOptions = errors.New("kpm: invalid 'kpm init' argument, you must provide a name for the package to be initialized.") +var InvalidInitOptions = errors.New("invalid 'kpm init' argument, you must provide a name for the package to be initialized.") // Invalid 'kpm add' -var InvalidAddOptions = errors.New("invalid 'kpm add' argument, you must provide a package name or url for the package.") -var InvalidAddOptionsInvalidGitUrl = errors.New("kpm: invalid 'kpm add' argument, you must provide a Git Url for the package.") -var InvalidAddOptionsInvalidOciRef = errors.New("kpm: invalid 'kpm add' argument, you must provide a valid Oci Ref for the package.") +var InvalidAddOptions = errors.New("invalid 'kpm add' argument, you must provide a package name or url for the package") +var InvalidAddOptionsInvalidGitUrl = errors.New("invalid 'kpm add' argument, you must provide a Git Url for the package.") +var InvalidAddOptionsInvalidOciRef = errors.New("invalid 'kpm add' argument, you must provide a valid Oci Ref for the package.") var InvalidAddOptionsInvalidOciReg = errors.New("invalid 'kpm add' argument, you must provide a Reg for the package.") var InvalidAddOptionsInvalidOciRepo = errors.New("invalid 'kpm add' argument, you must provide a Repo for the package.") // Invalid 'kpm run' -var InvalidRunOptionsWithoutEntryFiles = errors.New("kpm: invalid 'kpm run' argument, you must provide an entry file.") -var EntryFileNotFound = errors.New("kpm: entry file cannot be found, please make sure the '--input' entry file can be found") -var CompileFailed = errors.New("kpm: failed to compile kcl.") -var FailedUnTarKclPackage = errors.New("kpm: failed to untar kcl package, please re-download") -var UnknownTarFormat = errors.New("kpm: unknown tar format.") -var KclPacakgeTarNotFound = errors.New("kpm: the kcl package tar path is not found") -var InvalidKclPacakgeTar = errors.New("kpm: the kcl package tar path is an invalid *.tar file") +var InvalidRunOptionsWithoutEntryFiles = errors.New("invalid 'kpm run' argument, you must provide an entry file.") +var EntryFileNotFound = errors.New("entry file cannot be found, please make sure the '--input' entry file can be found") +var CompileFailed = errors.New("failed to compile kcl.") +var FailedUnTarKclPackage = errors.New("failed to untar kcl package, please re-download") +var UnknownTarFormat = errors.New("unknown tar format.") +var KclPacakgeTarNotFound = errors.New("the kcl package tar path is not found") +var InvalidKclPacakgeTar = errors.New("the kcl package tar path is an invalid *.tar file") // Invalid KCL_PKG_PATH var InvalidKpmHomeInCurrentPkg = errors.New("environment variable KCL_PKG_PATH cannot be set to the same path as the current KCL package.") // Invalid oci -var FailedLogin = errors.New("kpm: failed to login, please check registry, username and password is valid.") -var FailedLogout = errors.New("kpm: failed to logout, the registry not logged in.") -var FailedPull = errors.New("failed to pull kcl package.") -var FailedPushToOci = errors.New("kpm: failed to push kcl package tar to oci.") +var FailedLogin = errors.New("failed to login, please check registry, username and password is valid.") +var FailedLogout = errors.New("failed to logout, the registry not logged in.") +var FailedPull = errors.New("failed to pull kcl package") +var FailedPushToOci = errors.New("failed to push kcl package tar to oci.") var InvalidOciRef = errors.New("invalid oci reference.") -var NotOciUrl = errors.New("kpm: url is not an oci url.") -var IsOciRef = errors.New("kpm: oci ref is not an url.") +var NotOciUrl = errors.New("url is not an oci url.") +var IsOciRef = errors.New("oci ref is not an url.") // Invalid Version -var InvalidVersionFormat = errors.New("kpm: failed to parse version.") +var InvalidVersionFormat = errors.New("failed to parse version.") var PathNotFound = errors.New("path not found.") var PathIsEmpty = errors.New("path is empty.") var InvalidPkg = errors.New("invalid kcl package.") -var InvalidOciUrl = errors.New("invalid oci url.") -var UnknownEnv = errors.New("invalid environment variable.") +var InvalidOciUrl = errors.New("invalid oci url") +var UnknownEnv = errors.New("invalid environment variable") // No kcl files var NoKclFiles = errors.New("No input KCL files") diff --git a/pkg/oci/oci.go b/pkg/oci/oci.go index 5d8f690b..7de798a8 100644 --- a/pkg/oci/oci.go +++ b/pkg/oci/oci.go @@ -4,6 +4,7 @@ import ( "context" "fmt" "io" + "os" "path/filepath" v1 "github.com/opencontainers/image-spec/specs-go/v1" @@ -105,7 +106,7 @@ func NewOciClient(regName, repoName string, settings *settings.Settings) (*OciCl return nil, reporter.NewErrorEvent( reporter.RepoNotFound, err, - fmt.Sprintf("repository '%s' not found.", repoPath), + fmt.Sprintf("repository '%s' not found", repoPath), ) } ctx := context.Background() @@ -147,7 +148,7 @@ func (ociClient *OciClient) Pull(localPath, tag string) error { return reporter.NewErrorEvent( reporter.FailedGetPkg, err, - fmt.Sprintf("failed to get package with '%s' from '%s'.", tag, ociClient.repo.Reference.String()), + fmt.Sprintf("failed to get package with '%s' from '%s'", tag, ociClient.repo.Reference.String()), ) } @@ -172,7 +173,7 @@ func (ociClient *OciClient) TheLatestTag() (string, error) { return "", reporter.NewErrorEvent( reporter.FailedSelectLatestVersion, err, - fmt.Sprintf("failed to select latest version from '%s'.", ociClient.repo.Reference.String()), + fmt.Sprintf("failed to select latest version from '%s'", ociClient.repo.Reference.String()), ) } @@ -259,8 +260,8 @@ func (ociClient *OciClient) PushWithOciManifest(localPath, tag string, opts *opt return reporter.NewErrorEvent(reporter.FailedPush, err, fmt.Sprintf("failed to push '%s'", ociClient.repo.Reference)) } - reporter.ReportMsgTo(fmt.Sprintf("kpm: pushed [registry] %s", ociClient.repo.Reference), ociClient.logWriter) - reporter.ReportMsgTo(fmt.Sprintf("kpm: digest: %s", desc.Digest), ociClient.logWriter) + reporter.ReportMsgTo(fmt.Sprintf("pushed [registry] %s", ociClient.repo.Reference), ociClient.logWriter) + reporter.ReportMsgTo(fmt.Sprintf("digest: %s", desc.Digest), ociClient.logWriter) return nil } @@ -305,8 +306,9 @@ func Pull(localPath, hostName, repoName, tag string, settings *settings.Settings if err != nil { return err } - reporter.ReportEventToStdout( - reporter.NewEvent(reporter.SelectLatestVersion, "the lastest version '", tagSelected, "' will be pulled."), + reporter.ReportMsgTo( + fmt.Sprintf("the lastest version '%s' will be pulled", tagSelected), + os.Stdout, ) } else { tagSelected = tag diff --git a/pkg/oci/oci_test.go b/pkg/oci/oci_test.go index 21f4a35e..5edf46a9 100644 --- a/pkg/oci/oci_test.go +++ b/pkg/oci/oci_test.go @@ -38,5 +38,5 @@ func TestLogin(t *testing.T) { userPwd := "invalid_password" err := Login(hostName, userName, userPwd, &settings) - assert.Equal(t, err.Error(), "kpm: failed to login 'ghcr.io', please check registry, username and password is valid\nkpm: Get \"https://ghcr.io/v2/\": denied: denied\n") + assert.Equal(t, err.Error(), "error: failed to login 'ghcr.io', please check registry, username and password is valid\nerror: Get \"https://ghcr.io/v2/\": denied: denied\n") } diff --git a/pkg/package/package_test.go b/pkg/package/package_test.go index 91fcbd46..ae79fd10 100644 --- a/pkg/package/package_test.go +++ b/pkg/package/package_test.go @@ -87,7 +87,7 @@ func TestValidateKpmHome(t *testing.T) { oldValue := os.Getenv(env.PKG_PATH) os.Setenv(env.PKG_PATH, "test_home_path") err := kclPkg.ValidateKpmHome(os.Getenv(env.PKG_PATH)) - assert.Equal(t, err.Error(), "kpm: environment variable KCL_PKG_PATH cannot be set to the same path as the current KCL package.\n") + assert.Equal(t, err.Error(), "error: environment variable KCL_PKG_PATH cannot be set to the same path as the current KCL package.\n") assert.Equal(t, err.Type(), reporter.InvalidKpmHomeInCurrentPkg) os.Setenv(env.PKG_PATH, oldValue) } diff --git a/pkg/reporter/reporter.go b/pkg/reporter/reporter.go index 527acb15..2d352b0c 100644 --- a/pkg/reporter/reporter.go +++ b/pkg/reporter/reporter.go @@ -126,16 +126,10 @@ func (e *KpmEvent) Error() string { result := "" if e.msg != "" { // append msg - result = fmt.Sprintf("kpm: %s\n", e.msg) + result = fmt.Sprintf("error: %s\n", e.msg) } if e.err != nil { - // append err - _, ok := e.err.(*KpmEvent) - if !ok { - result = fmt.Sprintf("%skpm: %s\n", result, e.err.Error()) - } else { - result = fmt.Sprintf("%s%s\n", result, e.err.Error()) - } + result = fmt.Sprintf("%serror: %s\n", result, e.err.Error()) } return result } @@ -143,7 +137,7 @@ func (e *KpmEvent) Error() string { // Event returns the msg of the event without error message. func (e *KpmEvent) Event() string { if e.msg != "" { - return fmt.Sprintf("kpm: %s\n", e.msg) + return fmt.Sprintf("error: %s\n", e.msg) } return "" } diff --git a/pkg/semver/semver_test.go b/pkg/semver/semver_test.go index 04bf8f5e..6751f355 100644 --- a/pkg/semver/semver_test.go +++ b/pkg/semver/semver_test.go @@ -17,11 +17,11 @@ func TestLatestVersion(t *testing.T) { assert.Equal(t, latest, "") latest, err = LatestVersion([]string{"invalid_version"}) - assert.Equal(t, err.Error(), "kpm: failed to parse version invalid_version\nkpm: Malformed version: invalid_version\n") + assert.Equal(t, err.Error(), "error: failed to parse version invalid_version\nerror: Malformed version: invalid_version\n") assert.Equal(t, latest, "") latest, err = LatestVersion([]string{"1.2.3", "1.4.0", "1.3.5", "invalid_version"}) - assert.Equal(t, err.Error(), "kpm: failed to parse version invalid_version\nkpm: Malformed version: invalid_version\n") + assert.Equal(t, err.Error(), "error: failed to parse version invalid_version\nerror: Malformed version: invalid_version\n") assert.Equal(t, latest, "") } diff --git a/pkg/settings/settings.go b/pkg/settings/settings.go index 56a873e5..a6ef5f51 100644 --- a/pkg/settings/settings.go +++ b/pkg/settings/settings.go @@ -156,10 +156,10 @@ func (settings *Settings) LoadSettingsFromEnv() (*Settings, *reporter.KpmEvent) // Load the env OCI_REG_PLAIN_HTTP plainHttp := os.Getenv(DEFAULT_OCI_PLAIN_HTTP_ENV) - var err *reporter.KpmEvent + var err error if len(plainHttp) > 0 { settings.Conf.DefaultOciPlainHttp, err = isOn(plainHttp) - if err != (*reporter.KpmEvent)(nil) { + if err != nil { return settings, reporter.NewErrorEvent( reporter.UnknownEnv, err, @@ -170,16 +170,13 @@ func (settings *Settings) LoadSettingsFromEnv() (*Settings, *reporter.KpmEvent) return settings, nil } -func isOn(input string) (bool, *reporter.KpmEvent) { +func isOn(input string) (bool, error) { if strings.ToLower(input) == ON { return true, nil } else if strings.ToLower(input) == OFF { return false, nil } else { - return false, reporter.NewErrorEvent( - reporter.UnknownEnv, - errors.UnknownEnv, - ) + return false, errors.UnknownEnv } } diff --git a/pkg/settings/settings_test.go b/pkg/settings/settings_test.go index b787ab4a..0d8d1f2f 100644 --- a/pkg/settings/settings_test.go +++ b/pkg/settings/settings_test.go @@ -174,7 +174,7 @@ func TestSettingEnv(t *testing.T) { assert.Equal(t, settings.DefaultOciRegistry(), "test_reg") assert.Equal(t, settings.DefaultOciRepo(), "test_repo") assert.Equal(t, settings.ErrorEvent.Type(), reporter.UnknownEnv) - assert.Equal(t, settings.ErrorEvent.Error(), "kpm: unknown environment variable 'OCI_REG_PLAIN_HTTP=true'\nkpm: invalid environment variable.\n\n") + assert.Equal(t, settings.ErrorEvent.Error(), "error: unknown environment variable 'OCI_REG_PLAIN_HTTP=true'\nerror: invalid environment variable\n") assert.Equal(t, settings.DefaultOciPlainHttp(), false) err = os.Setenv("OCI_REG_PLAIN_HTTP", "on") diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index dcf83873..da4f316e 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -68,7 +68,7 @@ func HashDir(dir string) (string, error) { func StoreToFile(filePath string, dataStr string) error { file, err := os.Create(filePath) if err != nil { - reporter.ExitWithReport("kpm: failed to create file: ", filePath, err) + reporter.ExitWithReport("failed to create file: ", filePath, err) return err } defer file.Close() diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stderr index 8531b30c..c5cafb0d 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stderr @@ -1 +1 @@ -kpm: failed to select latest version from 'localhost:5001/test/path/to/not/exist'. +failed to select latest version from 'localhost:5001/test/path/to/not/exist' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout index f3da5808..0b9efb13 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_exist_not_pkgpath/test_suite.stdout @@ -1 +1 @@ -kpm: adding dependency '/path/to/not/exist'. +adding dependency '/path/to/not/exist' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_path_not_exist/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_path_not_exist/test_suite.stderr index c932e15b..e5af3895 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_path_not_exist/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_path_not_exist/test_suite.stderr @@ -1 +1 @@ -kpm: could not load 'kcl.mod' in '/an_invalid_kcl_pkg' +error: could not load 'kcl.mod' in '/an_invalid_kcl_pkg' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_current_path/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_current_path/test_suite.stderr index 1476c82c..c1b3072d 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_current_path/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_current_path/test_suite.stderr @@ -1 +1 @@ -kpm: cannot add 'kcl1' as a dependency to itself +cannot add 'kcl1' as a dependency to itself diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr index 3cefb68e..19ce4281 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stderr @@ -1 +1 @@ -kpm: failed to select latest version from 'localhost:5001/test/not_exist'. +failed to select latest version from 'localhost:5001/test/not_exist' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stdout index 235fb73a..2a9c1569 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_name/test_suite.stdout @@ -1 +1 @@ -kpm: adding dependency 'not_exist'. +adding dependency 'not_exist' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_ref/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_ref/test_suite.stderr index 400a4662..acb14e37 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_ref/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_invalid_ref/test_suite.stderr @@ -1 +1 @@ -kpm: invalid oci package reference 'k8s:k8s:1.0.0' +invalid oci package reference 'k8s:k8s:1.0.0' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stdout index 0675eea7..26b3802b 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stdout @@ -1,4 +1,4 @@ -kpm: adding dependency 'k8s'. -kpm: the lastest version '1.27' will be added. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: add dependency 'k8s' successfully. +adding dependency 'k8s' +the lastest version '1.27' will be added +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +add dependency 'k8s' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_1/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_1/test_suite.stdout index 9aa18272..5a9b9790 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_1/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_1/test_suite.stdout @@ -1,5 +1,5 @@ -kpm: adding dependency 'kcl1'. -kpm: the lastest version '0.0.1' will be added. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: add dependency 'kcl1' successfully. +adding dependency 'kcl1' +the lastest version '0.0.1' will be added +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +add dependency 'kcl1' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_2/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_2/test_suite.stdout index 31c36fa6..d777dc5e 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_2/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_2/test_suite.stdout @@ -1,6 +1,6 @@ -kpm: adding dependency 'kcl2'. -kpm: the lastest version '0.0.1' will be added. -kpm: downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: add dependency 'kcl2' successfully. +adding dependency 'kcl2' +the lastest version '0.0.1' will be added +downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +add dependency 'kcl2' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_3/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_3/test_suite.stdout index 31c36fa6..d777dc5e 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_3/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_3/test_suite.stdout @@ -1,6 +1,6 @@ -kpm: adding dependency 'kcl2'. -kpm: the lastest version '0.0.1' will be added. -kpm: downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: add dependency 'kcl2' successfully. +adding dependency 'kcl2' +the lastest version '0.0.1' will be added +downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +add dependency 'kcl2' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stderr index c4b438ad..65873b53 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: failed to get package with 'not_exist_tag' from 'localhost:5001/test/k8s'. -kpm: failed to resolve not_exist_tag: localhost:5001/test/k8s:not_exist_tag: not found +error: failed to get package with 'not_exist_tag' from 'localhost:5001/test/k8s' +error: failed to resolve not_exist_tag: localhost:5001/test/k8s:not_exist_tag: not found diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stdout index 280ff09f..512c787b 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_invalid_tag/test_suite.stdout @@ -1,2 +1,2 @@ -kpm: adding dependency 'k8s'. -kpm: downloading 'test/k8s:not_exist_tag' from 'localhost:5001/test/k8s:not_exist_tag'. +adding dependency 'k8s' +downloading 'test/k8s:not_exist_tag' from 'localhost:5001/test/k8s:not_exist_tag' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_tag/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_tag/test_suite.stdout index 10eaf60c..962a62f8 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_tag/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name_tag/test_suite.stdout @@ -1,3 +1,3 @@ -kpm: adding dependency 'k8s'. -kpm: downloading 'test/k8s:1.14' from 'localhost:5001/test/k8s:1.14'. -kpm: add dependency 'k8s:1.14' successfully. +adding dependency 'k8s' +downloading 'test/k8s:1.14' from 'localhost:5001/test/k8s:1.14' +add dependency 'k8s:1.14' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_no_args/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_no_args/test_suite.stderr index 7e0ee0a1..101527f4 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_no_args/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_no_args/test_suite.stderr @@ -1 +1 @@ -kpm: invalid 'kpm add' argument, you must provide a package name or url for the package. +error: invalid 'kpm add' argument, you must provide a package name or url for the package diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stderr index c62ac403..66202a75 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stderr @@ -1 +1 @@ -kpm: failed to select latest version from 'localhost:5001/test/path_not_exist'. \ No newline at end of file +failed to select latest version from 'localhost:5001/test/path_not_exist' \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout index 935fa54d..b1cc3c94 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_noexist_path/test_suite.stdout @@ -1 +1 @@ -kpm: adding dependency '/path_not_exist'. \ No newline at end of file +adding dependency '/path_not_exist' \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_1/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_1/test_suite.stdout index a62db34d..f07f329e 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_1/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_1/test_suite.stdout @@ -1,3 +1,3 @@ -kpm: adding dependency 'a_kcl_pkg_dep_pkg_name'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully. +adding dependency 'a_kcl_pkg_dep_pkg_name' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_2/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_2/test_suite.stdout index 64e75af8..e09b3055 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_2/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_2/test_suite.stdout @@ -1,4 +1,4 @@ -kpm: adding dependency 'a_kcl_pkg_dep_pkg_name'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully. +adding dependency 'a_kcl_pkg_dep_pkg_name' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_3/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_3/test_suite.stdout index 383a42f8..121a3934 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_3/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_3/test_suite.stdout @@ -1,5 +1,5 @@ -kpm: adding dependency 'a_kcl_pkg_dep_pkg_name'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully. +adding dependency 'a_kcl_pkg_dep_pkg_name' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1' +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_4/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_4/test_suite.stdout index 383a42f8..121a3934 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_4/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_4/test_suite.stdout @@ -1,5 +1,5 @@ -kpm: adding dependency 'a_kcl_pkg_dep_pkg_name'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully. +adding dependency 'a_kcl_pkg_dep_pkg_name' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1' +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_5/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_5/test_suite.stdout index 383a42f8..121a3934 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_5/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_path_5/test_suite.stdout @@ -1,5 +1,5 @@ -kpm: adding dependency 'a_kcl_pkg_dep_pkg_name'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1'. -kpm: downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1'. -kpm: add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully. +adding dependency 'a_kcl_pkg_dep_pkg_name' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +downloading 'test/kcl2:0.0.1' from 'localhost:5001/test/kcl2:0.0.1' +downloading 'test/kcl1:0.0.1' from 'localhost:5001/test/kcl1:0.0.1' +add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_relative_path/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_relative_path/test_suite.stdout index 55752965..0b7cd806 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_relative_path/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_relative_path/test_suite.stdout @@ -1,3 +1,3 @@ -kpm: adding dependency 'a_kcl_pkg_dep_pkg_name'. -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. -kpm: add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully. \ No newline at end of file +adding dependency 'a_kcl_pkg_dep_pkg_name' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' +add dependency 'a_kcl_pkg_dep_pkg_name:0.0.1' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/kpm_push_with_invalid_url/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/kpm_push_with_invalid_url/test_suite.stderr index fa768eb3..a480a118 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/kpm_push_with_invalid_url/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/kpm_push_with_invalid_url/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: only support url scheme 'oci://'. -kpm: invalid oci url. +error: only support url scheme 'oci://' +error: invalid oci url diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stderr index 7ee567d4..72cdbabd 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stderr @@ -1 +1 @@ -kpm: package version '0.0.1' already exists \ No newline at end of file +package version '0.0.1' already exists \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stdout index 5de249c3..ff7d937b 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_again/test_suite.stdout @@ -1 +1 @@ -kpm: package 'kcl1' will be pushed \ No newline at end of file +package 'kcl1' will be pushed \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stderr index 3536d0da..82a71ffc 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stderr @@ -1 +1 @@ -kpm: failed to access 'not_exist_reg/not_exist_repo' +failed to access 'not_exist_reg/not_exist_repo' diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stdout b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stdout index 871c3f63..656ef613 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/push_kcl1_reg_not_exist/test_suite.stdout @@ -1 +1 @@ -kpm: package 'kcl1' will be pushed +package 'kcl1' will be pushed diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/run_with_not_exist_input/test_suite.stderr b/test/e2e/test_suites/kpm/exec_inside_pkg/run_with_not_exist_input/test_suite.stderr index 8eb17e72..3e7de9a9 100644 --- a/test/e2e/test_suites/kpm/exec_inside_pkg/run_with_not_exist_input/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_inside_pkg/run_with_not_exist_input/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: failed to compile the kcl package -kpm: Cannot find the kcl file, please check the file path \ No newline at end of file +error: failed to compile the kcl package +error: Cannot find the kcl file, please check the file path \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/add_exist_not_pkgpath/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/add_exist_not_pkgpath/test_suite.stderr index bb0da759..19edfe80 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/add_exist_not_pkgpath/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/add_exist_not_pkgpath/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/add_path_not_exist/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/add_path_not_exist/test_suite.stderr index bb0da759..19edfe80 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/add_path_not_exist/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/add_path_not_exist/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_outside/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_outside/test_suite.stderr index bb0da759..19edfe80 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_outside/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_outside/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_tag_outside/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_tag_outside/test_suite.stderr index bb0da759..19edfe80 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_tag_outside/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_name_tag_outside/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_no_args_outside/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_no_args_outside/test_suite.stderr index bb0da759..19edfe80 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_no_args_outside/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/add_with_no_args_outside/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/init_with_no_args/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/init_with_no_args/test_suite.stdout index c997fe71..a7714ca8 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/init_with_no_args/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/init_with_no_args/test_suite.stdout @@ -1,4 +1,4 @@ -kpm: creating new :/kcl.mod -kpm: creating new :/kcl.mod.lock -kpm: creating new :/main.k -kpm: package 'test_kpm_workspace' init finished \ No newline at end of file +creating new :/kcl.mod +creating new :/kcl.mod.lock +creating new :/main.k +package 'test_kpm_workspace' init finished \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_no_args/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_no_args/test_suite.stderr index 6486305b..a24824e1 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_no_args/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_no_args/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: oci url or package name must be specified. -kpm: failed to pull kcl package. +error: oci url or package name must be specified +error: failed to pull kcl package diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout index 9ccf32e7..33f05b58 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url/test_suite.stdout @@ -1,4 +1,4 @@ -kpm: start to pull 'oci://localhost:5001/test/k8s'. -kpm: the lastest version '1.27' will be pulled. -kpm: pulling '/test/k8s:1.27' from 'localhost:5001/test/k8s'. -kpm: pulled 'oci://localhost:5001/test/k8s' in '/localhost:5001/test/k8s' successfully. \ No newline at end of file +start to pull 'oci://localhost:5001/test/k8s' +the lastest version '1.27' will be pulled +pulling '/test/k8s:1.27' from 'localhost:5001/test/k8s' +pulled 'oci://localhost:5001/test/k8s' in '/localhost:5001/test/k8s' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url_tag/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url_tag/test_suite.stdout index b1880461..3656dc86 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url_tag/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_oci_url_tag/test_suite.stdout @@ -1,3 +1,3 @@ -kpm: start to pull 'oci://localhost:5001/test/k8s' with tag '1.14'. -kpm: pulling '/test/k8s:1.14' from 'localhost:5001/test/k8s'. -kpm: pulled 'oci://localhost:5001/test/k8s' in '/localhost:5001/test/k8s/1.14' successfully. \ No newline at end of file +start to pull 'oci://localhost:5001/test/k8s' with tag '1.14' +pulling '/test/k8s:1.14' from 'localhost:5001/test/k8s' +pulled 'oci://localhost:5001/test/k8s' in '/localhost:5001/test/k8s/1.14' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_only_tag/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_only_tag/test_suite.stderr index 6486305b..a24824e1 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_only_tag/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_only_tag/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: oci url or package name must be specified. -kpm: failed to pull kcl package. +error: oci url or package name must be specified +error: failed to pull kcl package diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout index 9346b4d3..40ffd240 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name/test_suite.stdout @@ -1,4 +1,4 @@ -kpm: start to pull 'k8s'. -kpm: the lastest version '1.27' will be pulled. -kpm: pulling 'test/k8s:1.27' from 'localhost:5001/test/k8s'. -kpm: pulled 'k8s' in '/localhost:5001/test/k8s' successfully. \ No newline at end of file +start to pull 'k8s' +the lastest version '1.27' will be pulled +pulling 'test/k8s:1.27' from 'localhost:5001/test/k8s' +pulled 'k8s' in '/localhost:5001/test/k8s' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name_tag/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name_tag/test_suite.stdout index ab15009f..18289f76 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name_tag/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_pull_with_pkg_name_tag/test_suite.stdout @@ -1,3 +1,3 @@ -kpm: start to pull 'k8s:1.27'. -kpm: pulling 'test/k8s:1.27' from 'localhost:5001/test/k8s'. -kpm: pulled 'k8s:1.27' in '/localhost:5001/test/k8s/1.27' successfully. \ No newline at end of file +start to pull 'k8s:1.27' +pulling 'test/k8s:1.27' from 'localhost:5001/test/k8s' +pulled 'k8s:1.27' in '/localhost:5001/test/k8s/1.27' successfully \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_invalid_url/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_invalid_url/test_suite.stderr index fa768eb3..a480a118 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_invalid_url/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_invalid_url/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: only support url scheme 'oci://'. -kpm: invalid oci url. +error: only support url scheme 'oci://' +error: invalid oci url diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_no_args/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_no_args/test_suite.stderr index 7a53d5b3..7a8d6e9d 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_no_args/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/kpm_push_with_no_args/test_suite.stderr @@ -1 +1 @@ -kpm: failed to load package in \ No newline at end of file +failed to load package in \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/login_reg_without_username/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/login_reg_without_username/test_suite.stderr index 20fbbf3b..e931a06c 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/login_reg_without_username/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/login_reg_without_username/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: failed to login 'ghcr.io', please check registry, username and password is valid -kpm: Get "https://ghcr.io/v2/": unsupported \ No newline at end of file +error: failed to login 'ghcr.io', please check registry, username and password is valid +error: Get "https://ghcr.io/v2/": unsupported \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/login_with_no_args/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/login_with_no_args/test_suite.stderr index 3aa703a7..84574c1e 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/login_with_no_args/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/login_with_no_args/test_suite.stderr @@ -1,2 +1 @@ -kpm: run 'kpm login help' for more information -kpm: registry must be specified \ No newline at end of file +error: registry must be specified \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_with_invalid_reg/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_with_invalid_reg/test_suite.stderr index 9f8e38f7..40b63016 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_with_invalid_reg/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_with_invalid_reg/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: failed to logout 'invalid_registry' -kpm: not logged in \ No newline at end of file +error: failed to logout 'invalid_registry' +error: not logged in \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_without_args/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_without_args/test_suite.stderr index 6185640f..84574c1e 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_without_args/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/logout_reg_without_args/test_suite.stderr @@ -1,2 +1 @@ -kpm: run 'kpm logout help' for more information -kpm: registry must be specified \ No newline at end of file +error: registry must be specified \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/push_outside_pkg/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/push_outside_pkg/test_suite.stderr index cab3e8da..302a5c79 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/push_outside_pkg/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/push_outside_pkg/test_suite.stderr @@ -1 +1 @@ -kpm: failed to load package in '' \ No newline at end of file +failed to load package in '' \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stderr index 3509ad56..9fc609d9 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: failed to get package with 'invalid_tag' from 'localhost:5001/test/invalid_oci_repo'. -kpm: failed to resolve invalid_tag: localhost:5001/test/invalid_oci_repo:invalid_tag: not found \ No newline at end of file +error: failed to get package with 'invalid_tag' from 'localhost:5001/test/invalid_oci_repo' +error: failed to resolve invalid_tag: localhost:5001/test/invalid_oci_repo:invalid_tag: not found \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stdout b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stdout index 76ca84a3..95c3d648 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stdout +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_ref/test_suite.stdout @@ -1 +1 @@ -kpm: pulling 'test/invalid_oci_repo:invalid_tag' from 'localhost:5001/test/invalid_oci_repo'. \ No newline at end of file +pulling 'test/invalid_oci_repo:invalid_tag' from 'localhost:5001/test/invalid_oci_repo' \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url/test_suite.stderr index 9587f540..2adeb48a 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: repository 'invalid_url/' not found. -kpm: invalid reference: invalid repository +error: repository 'invalid_url/' not found +error: invalid reference: invalid repository diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url_without_tag/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url_without_tag/test_suite.stderr index b678b555..806a7430 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url_without_tag/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_oci_with_invalid_url_without_tag/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: repository 'invalid_rul/' not found. -kpm: invalid reference: invalid repository +error: repository 'invalid_rul/' not found +error: invalid reference: invalid repository diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_exist_not_tar/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_exist_not_tar/test_suite.stderr index 19b8ba4d..c9bb1138 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_exist_not_tar/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_exist_not_tar/test_suite.stderr @@ -1 +1 @@ -kpm: invalid file path 'exist_but_not_tar' \ No newline at end of file +invalid file path 'exist_but_not_tar' \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_noargs_input/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_noargs_input/test_suite.stderr index 3fb98399..752a3abb 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_noargs_input/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_noargs_input/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory \ No newline at end of file +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_input/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_input/test_suite.stderr index 8eb17e72..3e7de9a9 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_input/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_input/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: failed to compile the kcl package -kpm: Cannot find the kcl file, please check the file path \ No newline at end of file +error: failed to compile the kcl package +error: Cannot find the kcl file, please check the file path \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_tar/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_tar/test_suite.stderr index 34a3d732..a512306d 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_tar/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_tar_with_not_exist_tar/test_suite.stderr @@ -1 +1 @@ -kpm: the kcl package tar path is not found +the kcl package tar path is not found diff --git a/test/e2e/test_suites/kpm/exec_outside_pkg/run_with_no_args/test_suite.stderr b/test/e2e/test_suites/kpm/exec_outside_pkg/run_with_no_args/test_suite.stderr index 3fb98399..752a3abb 100644 --- a/test/e2e/test_suites/kpm/exec_outside_pkg/run_with_no_args/test_suite.stderr +++ b/test/e2e/test_suites/kpm/exec_outside_pkg/run_with_no_args/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: could not load 'kcl.mod' in '' -kpm: open /kcl.mod: no such file or directory \ No newline at end of file +error: could not load 'kcl.mod' in '' +error: open /kcl.mod: no such file or directory \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/ignores/kpm_push_without_url/test_suite.stderr b/test/e2e/test_suites/kpm/ignores/kpm_push_without_url/test_suite.stderr index 01a9be10..a71c24a0 100644 --- a/test/e2e/test_suites/kpm/ignores/kpm_push_without_url/test_suite.stderr +++ b/test/e2e/test_suites/kpm/ignores/kpm_push_without_url/test_suite.stderr @@ -1,2 +1 @@ -kpm: oci url must be specified. -kpm: run 'kpm push help' for more information. +error: oci url must be specified diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_kfile_1/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_kfile_1/test_suite.stderr index b6d684a8..16b68b9f 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_kfile_1/test_suite.stderr +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_kfile_1/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: only allows one package to be compiled at a time -kpm: cannot compile multiple packages [/test_kpm_run_with_multi_kfile_1 /test_kpm_run_with_multi_kfile_1/sub] at the same time +error: only allows one package to be compiled at a time +error: cannot compile multiple packages [/test_kpm_run_with_multi_kfile_1 /test_kpm_run_with_multi_kfile_1/sub] at the same time diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg/test_suite.stderr index 40747ed9..9ae6fe0c 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg/test_suite.stderr +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: only allows one package to be compiled at a time -kpm: cannot compile multiple packages [/test_kpm_run_with_multi_pkg/kcl1 /test_kpm_run_with_multi_pkg/kcl2] at the same time +error: only allows one package to be compiled at a time +error: cannot compile multiple packages [/test_kpm_run_with_multi_pkg/kcl1 /test_kpm_run_with_multi_pkg/kcl2] at the same time diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg_1/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg_1/test_suite.stderr index d5de4b9b..cd21a64b 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg_1/test_suite.stderr +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_multi_pkg_1/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: only allows one package to be compiled at a time -kpm: cannot compile multiple packages [/test_kpm_run_with_multi_pkg_1/kcl1 /test_kpm_run_with_multi_pkg_1/kcl2 oci://kcl-lang/kcl] at the same time +error: only allows one package to be compiled at a time +error: cannot compile multiple packages [/test_kpm_run_with_multi_pkg_1/kcl1 /test_kpm_run_with_multi_pkg_1/kcl2 oci://kcl-lang/kcl] at the same time diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_only_kcl_mod/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_only_kcl_mod/test_suite.stdout index c52b846e..fd85fdf6 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_only_kcl_mod/test_suite.stdout +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_with_only_kcl_mod/test_suite.stdout @@ -1,5 +1,5 @@ -kpm: adding 'k8s' -kpm: downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27'. +adding 'k8s' +downloading 'test/k8s:1.27' from 'localhost:5001/test/k8s:1.27' apiVersion: v1 kind: Pod metadata: diff --git a/test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.stdout b/test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.stdout index 9e7626c9..4929bed0 100644 --- a/test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.stdout +++ b/test/e2e/test_suites/kpm/test_oci/test_push_with_oci_manifest/test_suite.stdout @@ -1,3 +1,3 @@ -kpm: package 'test_push_with_oci_manifest' will be pushed -kpm: pushed [registry] localhost:5001/test/test_push_with_oci_manifest -kpm: digest: sha256: \ No newline at end of file +package 'test_push_with_oci_manifest' will be pushed +pushed [registry] localhost:5001/test/test_push_with_oci_manifest +digest: sha256: \ No newline at end of file diff --git a/test/e2e/test_suites/kpm/workflows/add_multi_times/1.init_an_empty_pkg/test_suite.stderr b/test/e2e/test_suites/kpm/workflows/add_multi_times/1.init_an_empty_pkg/test_suite.stderr index 5fc8ff4b..c12d60e8 100644 --- a/test/e2e/test_suites/kpm/workflows/add_multi_times/1.init_an_empty_pkg/test_suite.stderr +++ b/test/e2e/test_suites/kpm/workflows/add_multi_times/1.init_an_empty_pkg/test_suite.stderr @@ -1,3 +1,3 @@ -kpm: creating new : /kcl.mod -kpm: creating new : /kcl.mod.lock -kpm: package ' test_kpm_workspace ' init finished +creating new : /kcl.mod +creating new : /kcl.mod.lock +package ' test_kpm_workspace ' init finished diff --git a/test/e2e/test_suites/kpm/workflows/add_multi_times/2.first_add_konfig_dep/test_suite.stderr b/test/e2e/test_suites/kpm/workflows/add_multi_times/2.first_add_konfig_dep/test_suite.stderr index a0d2a43c..2a5b21cd 100644 --- a/test/e2e/test_suites/kpm/workflows/add_multi_times/2.first_add_konfig_dep/test_suite.stderr +++ b/test/e2e/test_suites/kpm/workflows/add_multi_times/2.first_add_konfig_dep/test_suite.stderr @@ -1,2 +1,2 @@ -kpm: adding dependency konfig -kpm: add dependency successfully. +adding dependency konfig +add dependency successfully diff --git a/test/e2e/test_suites/kpm/workflows/add_multi_times/3.second_add_konfig_dep/test_suite.stderr b/test/e2e/test_suites/kpm/workflows/add_multi_times/3.second_add_konfig_dep/test_suite.stderr index 3e28c1a9..9b0759fb 100644 --- a/test/e2e/test_suites/kpm/workflows/add_multi_times/3.second_add_konfig_dep/test_suite.stderr +++ b/test/e2e/test_suites/kpm/workflows/add_multi_times/3.second_add_konfig_dep/test_suite.stderr @@ -1 +1 @@ -kpm: add dependency successfully. +add dependency successfully diff --git a/test/e2e/test_suites/kpm/workflows/add_multi_times/4.third_add_konfig_dep/test_suite.stderr b/test/e2e/test_suites/kpm/workflows/add_multi_times/4.third_add_konfig_dep/test_suite.stderr index 3e28c1a9..9b0759fb 100644 --- a/test/e2e/test_suites/kpm/workflows/add_multi_times/4.third_add_konfig_dep/test_suite.stderr +++ b/test/e2e/test_suites/kpm/workflows/add_multi_times/4.third_add_konfig_dep/test_suite.stderr @@ -1 +1 @@ -kpm: add dependency successfully. +add dependency successfully diff --git a/test/e2e/test_suites/kpm/workflows/init_and_run/1.init_an_empty_pkg/test_suite.stdout b/test/e2e/test_suites/kpm/workflows/init_and_run/1.init_an_empty_pkg/test_suite.stdout index c997fe71..a7714ca8 100644 --- a/test/e2e/test_suites/kpm/workflows/init_and_run/1.init_an_empty_pkg/test_suite.stdout +++ b/test/e2e/test_suites/kpm/workflows/init_and_run/1.init_an_empty_pkg/test_suite.stdout @@ -1,4 +1,4 @@ -kpm: creating new :/kcl.mod -kpm: creating new :/kcl.mod.lock -kpm: creating new :/main.k -kpm: package 'test_kpm_workspace' init finished \ No newline at end of file +creating new :/kcl.mod +creating new :/kcl.mod.lock +creating new :/main.k +package 'test_kpm_workspace' init finished \ No newline at end of file