Skip to content

Commit

Permalink
fix: fix CR comments
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <[email protected]>
  • Loading branch information
zong-zhe committed May 23, 2024
1 parent 0195cb7 commit e493d91
Show file tree
Hide file tree
Showing 21 changed files with 168 additions and 130 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: e2e test
on:
pull_request:
branches:
- main
push:
branches:
- main
on: push
# pull_request:
# branches:
# - main
# push:
# branches:
# - main

jobs:
e2e:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test-win.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Windows Test
on:
pull_request:
branches:
- main
push:
branches:
- main
on: push
# pull_request:
# branches:
# - main
# push:
# branches:
# - main

jobs:
TestWindows:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Reference from:
# https://github.com/c-bata/go-prompt/blob/master/.github/workflows/test.yml
name: Test
on:
pull_request:
branches:
- main
push:
branches:
- main
on: push
# pull_request:
# branches:
# - main
# push:
# branches:
# - main

jobs:
Test:
Expand Down
6 changes: 3 additions & 3 deletions pkg/3rdparty/mvs/mvs.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func Req(mainModule module.Version, base []string, reqs Reqs) ([]module.Version,
}
have[m] = true
for _, m1 := range reqCache[m] {
walk(m1)
_ = walk(m1)
}
return nil
}
Expand All @@ -249,7 +249,7 @@ func Req(mainModule module.Version, base []string, reqs Reqs) ([]module.Version,
}
m := module.Version{Path: path, Version: max[path]}
min = append(min, m)
walk(m)
_ = walk(m)
haveBase[path] = true
}
// Now the reverse postorder to bring in anything else.
Expand All @@ -261,7 +261,7 @@ func Req(mainModule module.Version, base []string, reqs Reqs) ([]module.Version,
}
if !have[m] {
min = append(min, m)
walk(m)
_ = walk(m)
}
}
sort.Slice(min, func(i, j int) bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/kpm_pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (pkg *KclPackage) UpdateDependencyInPath(pkg_path string) error {
if err != nil {
return err
}
return kpmcli.ResolvePkgDepsMetadata(pkg.pkg, &pkg.pkg.Dependencies, true)
return kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true)
}

// GetPkgName returns the name of the package.
Expand Down
12 changes: 6 additions & 6 deletions pkg/api/kpm_pkg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestPackageApi(t *testing.T) {
assert.Equal(t, err, nil)
pkg, err := GetKclPackage(pkg_path)
assert.Equal(t, err, nil)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, &pkg.pkg.Dependencies, true)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true)
assert.Equal(t, err, nil)
assert.Equal(t, pkg.GetPkgName(), "kcl_pkg")
assert.Equal(t, pkg.GetVersion(), "0.0.1")
Expand All @@ -33,7 +33,7 @@ func TestPackageApi(t *testing.T) {
assert.Equal(t, dep.Source.Oci.Repo, "kcl-lang/k8s")
assert.Equal(t, dep.Source.Oci.Tag, "1.27")

assert.Equal(t, dep.GetLocalFullPath(), filepath.Join(kcl_pkg_path, "k8s_1.27"))
assert.Equal(t, dep.GetLocalFullPath(""), filepath.Join(kcl_pkg_path, "k8s_1.27"))

schemas, err := pkg.GetAllSchemaTypeMapping()
assert.Equal(t, err, nil)
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestGetAllSchemaTypesMappingNamed(t *testing.T) {
kpmcli, err := client.NewKpmClient()
assert.Equal(t, err, nil)

err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, &pkg.pkg.Dependencies, true)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true)
assert.Equal(t, err, nil)

schemas, err := pkg.GetSchemaTypeMappingNamed("SchemaWithSameName")
Expand All @@ -103,7 +103,7 @@ func TestGetSchemaTypeMappingWithFilters(t *testing.T) {
assert.Equal(t, err, nil)
kpmcli, err := client.NewKpmClient()
assert.Equal(t, err, nil)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, &pkg.pkg.Dependencies, true)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true)
assert.Equal(t, err, nil)

filterFunc := func(kt *KclType) bool {
Expand Down Expand Up @@ -154,7 +154,7 @@ func TestGetFullSchemaTypeMappingWithFilters(t *testing.T) {
assert.Equal(t, err, nil)
kpmcli, err := client.NewKpmClient()
assert.Equal(t, err, nil)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, &pkg.pkg.Dependencies, true)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true)
assert.Equal(t, err, nil)

filterFunc := func(kt *KclType) bool {
Expand All @@ -175,7 +175,7 @@ func TestGetSchemaTypeUnderEmptyDir(t *testing.T) {
assert.Equal(t, err, nil)
kpmcli, err := client.NewKpmClient()
assert.Equal(t, err, nil)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, &pkg.pkg.Dependencies, true)
err = kpmcli.ResolvePkgDepsMetadata(pkg.pkg, true)
assert.Equal(t, err, nil)
schemas, err := pkg.GetSchemaTypeMappingNamed("SchemaInMain")
assert.Equal(t, err, nil)
Expand Down
2 changes: 1 addition & 1 deletion pkg/api/test_data/test_run_pkg_in_path/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"a":{"containers":{"flaskdemo":{"image":"kcllang/flask_demo:8d31498e765ff67a2fa9933d4adffe067544b2fe","ports":[{"containerPort":5000,"protocol":"TCP"}]}},"labels":{"app":"flask-demo"},"name":"flask-demo","replicas":1,"service":{"ports":[{"port":5000,"protocol":"TCP","targetPort":5000}],"type":"NodePort"}}}
{"a": {"name": "flask-demo", "replicas": 1, "labels": {"app": "flask-demo"}, "service": {"type": "NodePort", "ports": [{"port": 5000, "protocol": "TCP", "targetPort": 5000}]}, "containers": {"flaskdemo": {"image": "kcllang/flask_demo:8d31498e765ff67a2fa9933d4adffe067544b2fe", "ports": [{"protocol": "TCP", "containerPort": 5000}]}}}}
2 changes: 1 addition & 1 deletion pkg/api/test_data/test_run_tar_in_path/expected.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"a":{"containers":{"flaskdemo":{"image":"kcllang/flask_demo:8d31498e765ff67a2fa9933d4adffe067544b2fe","ports":[{"containerPort":5000,"protocol":"TCP"}]}},"labels":{"app":"flask-demo"},"name":"flask-demo","replicas":1,"service":{"ports":[{"port":5000,"protocol":"TCP","targetPort":5000}],"type":"NodePort"}}}
{"a": {"name": "flask-demo", "replicas": 1, "labels": {"app": "flask-demo"}, "service": {"type": "NodePort", "ports": [{"port": 5000, "protocol": "TCP", "targetPort": 5000}]}, "containers": {"flaskdemo": {"image": "kcllang/flask_demo:8d31498e765ff67a2fa9933d4adffe067544b2fe", "ports": [{"protocol": "TCP", "containerPort": 5000}]}}}}
Loading

0 comments on commit e493d91

Please sign in to comment.