From 123e4269941c67d730b1d8637fb218b2f29db3ed Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 14:39:51 +0800 Subject: [PATCH 1/2] fix: rm log 'adding' during updating the dependencies Signed-off-by: zongz --- pkg/client/client.go | 12 ------------ .../test_suite.stdout | 1 - 2 files changed, 13 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index c744ed76..744b8a68 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -309,18 +309,6 @@ func (c *KpmClient) resolvePkgDeps(kclPkg *pkg.KclPkg, lockDeps *pkg.Dependencie // 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 { - if len(d.Version) == 0 { - reporter.ReportMsgTo( - fmt.Sprintf("adding '%s'", name), - c.logWriter, - ) - } else { - reporter.ReportMsgTo( - fmt.Sprintf("adding '%s' with version '%s'", name, d.Version), - c.logWriter, - ) - } - kclPkg.Dependencies.Deps[name] = d } } diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout index 17e6ee31..f4059255 100644 --- a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout +++ b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_4/test_suite.stdout @@ -1,2 +1 @@ -adding 'pkg2' The_first_kcl_program: Hello World! \ No newline at end of file From 4cb17d4a075c58c7d50879e7bda56189ecd6aaf9 Mon Sep 17 00:00:00 2001 From: zongz Date: Mon, 27 May 2024 15:02:27 +0800 Subject: [PATCH 2/2] fix: fix test case Signed-off-by: zongz --- pkg/client/client_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index d0df4502..00b44831 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -1073,7 +1073,7 @@ func TestUpdateWithNoSumCheck(t *testing.T) { err = kpmcli.UpdateDeps(kclPkg) assert.Equal(t, err, nil) assert.Equal(t, utils.DirExists(filepath.Join(pkgPath, "kcl.mod.lock")), true) - assert.Equal(t, buf.String(), "adding 'helloworld' with version '0.1.1'\n") + assert.Equal(t, buf.String(), "") defer func() { _ = os.Remove(filepath.Join(pkgPath, "kcl.mod.lock"))