Skip to content

Commit

Permalink
fix: replace test case helloworld by flask_manifests
Browse files Browse the repository at this point in the history
Signed-off-by: zongz <zongzhe1024@163.com>
  • Loading branch information
zong-zhe committed Nov 13, 2024
1 parent 9622092 commit 81a38e4
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 15 deletions.
2 changes: 1 addition & 1 deletion pkg/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ func TestWithGlobalLock(t *testing.T) {
test.RunTestWithGlobalLock(t, "testPullWithOnlySpec", testPullWithOnlySpec)
test.RunTestWithGlobalLock(t, "TestRunWithModSpecVersion", testRunWithModSpecVersion)
test.RunTestWithGlobalLock(t, "TestGraph", testGraph)
test.RunTestWithGlobalLock(t, "testRunWithHyphenEntries", testRunWithHyphenEntries)
test.RunTestWithGlobalLock(t, "testUpdate", testUpdate)
test.RunTestWithGlobalLock(t, "testRunWithNoSumCheck", testRunWithNoSumCheck)
test.RunTestWithGlobalLock(t, "testCyclicDependency", testCyclicDependency)
Expand All @@ -113,6 +112,7 @@ func TestWithGlobalLock(t *testing.T) {
test.RunTestWithGlobalLock(t, "TestAddDepsWithInsecureSkipTLSverify", testAddDepsWithInsecureSkipTLSverify)
test.RunTestWithGlobalLock(t, "testPushWithInsecureSkipTLSverify", testPushWithInsecureSkipTLSverify)
test.RunTestWithGlobalLock(t, "testMetadataOffline", testMetadataOffline)
test.RunTestWithGlobalLock(t, "testRunWithHyphenEntries", testRunWithHyphenEntries)

features.Enable(features.SupportNewStorage)
test.RunTestWithGlobalLock(t, "testAddWithModSpec", testAddWithModSpec)
Expand Down
10 changes: 5 additions & 5 deletions pkg/client/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ func testRunWithHyphenEntries(t *testing.T) {
t.Fatal(err)
}

expect := `The_first_kcl_program_current_mod: Hello Current Mod World!
The_fisrt_schema_inst:
msg: Hello Schema!
The_first_kcl_program: Hello World!`
expect, err := os.ReadFile(filepath.Join(pkgPath, "stdout"))
if err != nil {
t.Fatal(err)
}

assert.Equal(t, utils.RmNewline(res.GetRawYamlResult()), utils.RmNewline(expect))
assert.Equal(t, utils.RmNewline(res.GetRawYamlResult()), utils.RmNewline(string(expect)))
}
4 changes: 2 additions & 2 deletions pkg/client/test_data/test_run_hyphen_entries/kcl.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ edition = "v0.10.0"
version = "0.0.1"

[dependencies]
hello-world = { package = "helloworld", version = "0.1.4" }
flask_manifests = { git = "https://github.com/kcl-lang/flask-demo-kcl-manifests.git", commit = "ade147b", version = "0.0.1" }

[profile]
entries = ["main.k", "${hello-world:KCL_MOD}/main.k"]
entries = ["main.k", "${flask-manifests:KCL_MOD}/main.k"]
13 changes: 6 additions & 7 deletions pkg/client/test_data/test_run_hyphen_entries/kcl.mod.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
[dependencies]
[dependencies.hello-world]
name = "hello-world"
full_name = "helloworld_0.1.4"
version = "0.1.4"
reg = "ghcr.io"
repo = "kcl-lang/helloworld"
oci_tag = "0.1.4"
[dependencies.flask_manifests]
name = "flask_manifests"
full_name = "flask_manifests_0.0.1"
version = "0.0.1"
url = "https://github.com/kcl-lang/flask-demo-kcl-manifests.git"
commit = "ade147b"
18 changes: 18 additions & 0 deletions pkg/client/test_data/test_run_hyphen_entries/stdout
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
The_first_kcl_program_current_mod: Hello Current Mod World!
config:
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

0 comments on commit 81a38e4

Please sign in to comment.