Skip to content

Commit

Permalink
fix: fix unix test
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <zongzhe1024@163.com>
  • Loading branch information
zong-zhe committed Mar 13, 2024
1 parent d923f27 commit 056ef88
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 7 deletions.
11 changes: 9 additions & 2 deletions pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"log"
"os"
"path/filepath"
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -1186,7 +1187,13 @@ func TestAddWithDiffVersionWithSumCheck(t *testing.T) {
func TestAddWithGitCommit(t *testing.T) {
pkgPath := getTestDir("add_with_git_commit")

testPkgPath := filepath.Join(pkgPath, "test_pkg")
testPkgPath := ""
if runtime.GOOS == "windows" {
testPkgPath = filepath.Join(pkgPath, "test_pkg_win")
} else {
testPkgPath = filepath.Join(pkgPath, "test_pkg")
}

testPkgPathModBak := filepath.Join(testPkgPath, "kcl.mod.bak")
testPkgPathMod := filepath.Join(testPkgPath, "kcl.mod")
testPkgPathModExpect := filepath.Join(testPkgPath, "kcl.mod.expect")
Expand All @@ -1205,7 +1212,7 @@ func TestAddWithGitCommit(t *testing.T) {
assert.Equal(t, err, nil)

opts := opt.AddOptions{
LocalPath: pkgPath,
LocalPath: testPkgPath,
RegistryOpts: opt.RegistryOptions{
Git: &opt.GitOptions{
Url: "https://github.com/KusionStack/catalog.git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "zhh1yHk5TrNi9apHUQF3hPOlwi5Kc75cNHjcVmGv+Qo="
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[package]
name = "with_sum_check"
edition = "0.0.1"
version = "0.0.1"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "with_sum_check"
edition = "0.0.1"
version = "0.0.1"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "a29e3db" }
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[dependencies]
[dependencies.catalog]
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "zhh1yHk5TrNi9apHUQF3hPOlwi5Kc75cNHjcVmGv+Qo="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The_first_kcl_program = 'Hello World!'
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name = "catalog"
full_name = "catalog_c5435e733"
version = "c5435e733"
sum = "zhh1yHk5TrNi9apHUQF3hPOlwi5Kc75cNHjcVmGv+Qo="
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
url = "https://github.com/KusionStack/catalog.git"
commit = "c5435e733"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "zhh1yHk5TrNi9apHUQF3hPOlwi5Kc75cNHjcVmGv+Qo="
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "zhh1yHk5TrNi9apHUQF3hPOlwi5Kc75cNHjcVmGv+Qo="
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "zhh1yHk5TrNi9apHUQF3hPOlwi5Kc75cNHjcVmGv+Qo="
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"

0 comments on commit 056ef88

Please sign in to comment.