Skip to content

Commit

Permalink
fix: fix e2e test cases
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 14, 2024
1 parent e2b2982 commit 7655231
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 80 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.50.1
timeout: 5m
args: --timeout 5m
2 changes: 1 addition & 1 deletion pkg/api/kpm_run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func TestRunWithOptsAndNoSumCheck(t *testing.T) {
modLock := filepath.Join(workDir, "kcl.mod.lock")
expected, err := os.ReadFile(filepath.Join(pkgPath, testCase, "expected"))
assert.Equal(t, err, nil)

fmt.Printf("testCase: %v\n", testCase)
res, err := RunWithOpts(
opt.WithNoSumCheck(true),
opt.WithEntries([]string{pathMainK}),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ helloworld:
url: http://localhost:80
initialDelaySeconds: 10
replicas: 2
accessories:
test: aaa
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,6 @@ helloworld: ac.AppConfiguration {
# Set the replicas
replicas: 2
}

accessories: {"test": "aaa"}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
kpm add -git https://github.com/KusionStack/catalog.git -commit a29e3db
kpm add -git https://github.com/KusionStack/catalog.git -commit 3891e96
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
adding dependency 'catalog'
cloning 'https://github.com/KusionStack/catalog.git' with commit 'a29e3db'
cloning 'https://github.com/KusionStack/catalog.git' with commit '3891e96'
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,11 @@ helloworld:
username: admin
password: '******'
replicas: 2
type: Deployment
ports:
- port: 80
targetPort: 8080
protocol: TCP
public: true
monitoring:
interval: 30s
timeout: 15s
path: /metrics
port: web
scheme: http
helloworldcollaset:
workload:
containers:
Expand All @@ -55,8 +48,6 @@ helloworldcollaset:
- -c
- echo hi
workingDir: /tmp
replicas: 2
type: CollaSet
ports:
- port: 80
protocol: TCP
Expand All @@ -72,5 +63,4 @@ helloworldjob:
- /bin/sh
- -c
- echo hello
replicas: 2
schedule: 0 * * * *
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@ workload:
url: http://localhost:80
initialDelaySeconds: 10
replicas: 2
monitoring:
interval: 30s
timeout: 15s
path: /metrics
port: web
scheme: http
accessories:
test: test
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,5 @@ a:
url: http://localhost:80
initialDelaySeconds: 10
replicas: 2
monitoring:
interval: 30s
timeout: 15s
path: /metrics
port: web
scheme: http
accessories:
test: test
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
1
2 changes: 1 addition & 1 deletion test/e2e/test_suites/test_data/test_kpm_run_quiet/kcl.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ edition = "0.0.1"
version = "0.0.1"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.0" }
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.2" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[dependencies]
[dependencies.catalog]
name = "catalog"
full_name = "catalog_0.1.0"
version = "0.1.0"
sum = "9nAzXsUVVbIJieEc+8x97Sb7AxfdU7RyEm5mNYLTP3M="
full_name = "catalog_0.1.2"
version = "0.1.2"
sum = "e7SJn6NcteDaUKutlzd1q5HrPE6D+EGvmqOB0fcV7pw="
url = "https://github.com/KusionStack/catalog.git"
git_tag = "0.1.0"
git_tag = "0.1.2"
9 changes: 0 additions & 9 deletions test/e2e/test_suites/test_data/test_kpm_run_quiet/main.k
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,10 @@ helloworld: ac.AppConfiguration {
}
]
}
# Add the monitoring configuration backed by Prometheus
monitoring: m.Prometheus{
interval: "30s"
timeout: "15s"
path: "/metrics"
port: "web"
scheme: "http"
}
}

helloworldcollaset: ac.AppConfiguration {
workload: wl.Service {
type: "CollaSet"
containers: {
"nginx": c.Container {
image: "nginx:v1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ edition = "0.0.1"
version = "0.0.1"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "a29e3db" }
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "3891e96" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[dependencies]
[dependencies.catalog]
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
full_name = "catalog_3891e96"
version = "3891e96"
sum = "Wu6MtY5rNDPGICQ3TJbqx13yN1dVbAYmpVcz/4HejJo="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
commit = "3891e96"
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ ac.AppConfiguration {
# Set the replicas
replicas: 2
}
# Add the monitoring configuration backed by Prometheus
monitoring: m.Prometheus{
interval: "30s"
timeout: "15s"
path: "/metrics"
port: "web"
scheme: "http"
accessories: {
"test": "test"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ edition = "0.0.1"
version = "0.0.1"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "a29e3db" }
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "3891e96" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[dependencies]
[dependencies.catalog]
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
full_name = "catalog_3891e96"
version = "3891e96"
sum = "Wu6MtY5rNDPGICQ3TJbqx13yN1dVbAYmpVcz/4HejJo="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
commit = "3891e96"
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ edition = "0.0.1"
version = "0.0.1"

[dependencies]
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "a29e3db" }
catalog = { git = "https://github.com/KusionStack/catalog.git", commit = "3891e96" }
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[dependencies]
[dependencies.catalog]
name = "catalog"
full_name = "catalog_a29e3db"
version = "a29e3db"
full_name = "catalog_3891e96"
version = "3891e96"
sum = "kFmlrYJbJUFFTEXjC9cquc80WB+UpZ/6oMPKrfgyeks="
url = "https://github.com/KusionStack/catalog.git"
commit = "a29e3db"
commit = "3891e96"
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ sub_app = ac.AppConfiguration {
# Set the replicas
replicas: 2
}
# Add the monitoring configuration backed by Prometheus
monitoring: m.Prometheus{
interval: "30s"
timeout: "15s"
path: "/metrics"
port: "web"
scheme: "http"
accessories: {
"test": "test"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ version = "0.0.1"
[dependencies]
test_update_1 = { path = "./../test_update_1" }
helloworld = "0.1.1"
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.1" }
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.2" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[dependencies]
[dependencies.catalog]
name = "catalog"
full_name = "catalog_0.1.2"
version = "0.1.2"
sum = "e7SJn6NcteDaUKutlzd1q5HrPE6D+EGvmqOB0fcV7pw="
url = "https://github.com/KusionStack/catalog.git"
git_tag = "0.1.2"
[dependencies.helloworld]
name = "helloworld"
full_name = "helloworld_0.1.1"
version = "0.1.1"
sum = "7OO4YK2QuRWPq9C7KTzcWcti5yUnueCjptT3OXiPVeQ="
reg = "ghcr.io"
repo = "kcl-lang/helloworld"
oci_tag = "0.1.1"
[dependencies.test_update_1]
name = "test_update_1"
full_name = "test_update_1_"
sum = "PYLgSMWbY5vCU2cyK+hOkZeb0Rp7JW055b0RMQaQ4S8="
path = "./../test_update_1"
Original file line number Diff line number Diff line change
Expand Up @@ -57,26 +57,16 @@ hello: ac.AppConfiguration {
replicas: 2
ports: [
n.Port {
type: "aliyun"
port: 80
targetPort: 8080
public: True
}
]
}
# Add the monitoring configuration backed by Prometheus
monitoring: m.Prometheus{
interval: "30s"
timeout: "15s"
path: "/metrics"
port: "web"
scheme: "http"
}
}

hellocollaset: ac.AppConfiguration {
workload: wl.Service {
type: "CollaSet"
containers: {
"nginx": c.Container {
image: "nginx:v1"
Expand Down

0 comments on commit 7655231

Please sign in to comment.