From bfd27982f58a16051af2cfd8a512929c291b1679 Mon Sep 17 00:00:00 2001 From: zongz Date: Wed, 13 Nov 2024 14:20:55 +0800 Subject: [PATCH] fix: move test case into global lock Signed-off-by: zongz --- pkg/client/add_test.go | 2 +- pkg/client/client_test.go | 4 ++-- pkg/package/test_data/test_rename_pkg/kcl.mod.lock | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 pkg/package/test_data/test_rename_pkg/kcl.mod.lock diff --git a/pkg/client/add_test.go b/pkg/client/add_test.go index 7a84f067..3162dcfe 100644 --- a/pkg/client/add_test.go +++ b/pkg/client/add_test.go @@ -13,7 +13,7 @@ import ( "kcl-lang.io/kpm/pkg/utils" ) -func TestAddWithModSpec(t *testing.T) { +func testAddWithModSpec(t *testing.T) { tests := []struct { name string pkgSubPath string diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 3be4264d..f7520727 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -83,7 +83,7 @@ func TestWithGlobalLock(t *testing.T) { test.RunTestWithGlobalLock(t, "TestDownloadGitWithPackage", testDownloadGitWithPackage) test.RunTestWithGlobalLock(t, "TestModandLockFilesWithGitPackageDownload", testModandLockFilesWithGitPackageDownload) test.RunTestWithGlobalLock(t, "TestDependencyGraph", testDependencyGraph) - test.RunTestWithGlobalLock(t, "TestAddWithModSpec", TestAddWithModSpec) + test.RunTestWithGlobalLock(t, "TestAddWithModSpec", testAddWithModSpec) test.RunTestWithGlobalLock(t, "TestRunRemoteWithArgsInvalid", testRunRemoteWithArgsInvalid) test.RunTestWithGlobalLock(t, "TestRunRemoteWithArgs", testRunRemoteWithArgs) test.RunTestWithGlobalLock(t, "TestRunWithNoSumCheck", testRunWithGitPackage) @@ -101,7 +101,7 @@ func TestWithGlobalLock(t *testing.T) { test.RunTestWithGlobalLock(t, "TestGraph", testGraph) features.Enable(features.SupportNewStorage) - test.RunTestWithGlobalLock(t, "testAddWithModSpec", TestAddWithModSpec) + test.RunTestWithGlobalLock(t, "testAddWithModSpec", testAddWithModSpec) test.RunTestWithGlobalLock(t, "testAddWithOnlyModSpec", testAddWithOnlyModSpec) test.RunTestWithGlobalLock(t, "testAddRenameWithModSpec", testAddRenameWithModSpec) test.RunTestWithGlobalLock(t, "testAddRenameWithNoSpec", testAddRenameWithNoSpec) diff --git a/pkg/package/test_data/test_rename_pkg/kcl.mod.lock b/pkg/package/test_data/test_rename_pkg/kcl.mod.lock new file mode 100644 index 00000000..fe419bb8 --- /dev/null +++ b/pkg/package/test_data/test_rename_pkg/kcl.mod.lock @@ -0,0 +1,8 @@ +[dependencies] + [dependencies.newpkg] + name = "newpkg" + full_name = "newpkg_0.0.1" + version = "0.0.1" + reg = "ghcr.io" + repo = "kcl-lang/helloworld" + oci_tag = "0.1.4"