-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance config to schema type check on union expr
Signed-off-by: peefy <[email protected]>
- Loading branch information
Showing
16 changed files
with
178 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
schema Container: | ||
name: str | ||
image: str | ||
volumeMounts: [{str:}] | ||
|
||
config = { | ||
image = "test/test-container:test-cluster" | ||
volumeMounts = [{ | ||
name = "config" | ||
mountPath = "/app/config" | ||
}] | ||
} | ||
|
||
expected: Container = config | {name = "test-repo/test-image:test-tag"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
config: | ||
image: test/test-container:test-cluster | ||
volumeMounts: | ||
- name: config | ||
mountPath: /app/config | ||
expected: | ||
name: test-repo/test-image:test-tag | ||
image: test/test-container:test-cluster | ||
volumeMounts: | ||
- name: config | ||
mountPath: /app/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
schema Container: | ||
name: str | ||
image: str | ||
volumeMounts: [{str:}] | ||
|
||
schema Config: | ||
_config = { | ||
image = "test/test-container:test-cluster" | ||
volumeMounts = [{ | ||
name = "config" | ||
mountPath = "/app/config" | ||
}] | ||
} | ||
expected: Container = _config | {name = "test-repo/test-image:test-tag"} | ||
|
||
config = Config {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
config: | ||
expected: | ||
name: test-repo/test-image:test-tag | ||
image: test/test-container:test-cluster | ||
volumeMounts: | ||
- name: config | ||
mountPath: /app/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
schema Container: | ||
name: str | ||
image: str | ||
volumeMounts: [{str:}] | ||
|
||
config = { | ||
image = "test/test-container:test-cluster" | ||
volumeMounts = [{ | ||
name = "config" | ||
mountPath = "/app/config" | ||
}] | ||
} | ||
|
||
expected: Container = config | {name = 1} |
6 changes: 6 additions & 0 deletions
6
test/grammar/types/union_expr/union_expr_fail_0/stderr.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error[E2G22]: TypeError | ||
--> ${CWD}/main.k:14:33 | ||
| | ||
14 | expected: Container = config | {name = 1} | ||
| ^ expected str, got int(1) | ||
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
schema Container: | ||
name: str | ||
image: str | ||
volumeMounts: [{str:}] | ||
|
||
schema Config: | ||
_config = { | ||
image = "test/test-container:test-cluster" | ||
volumeMounts = [{ | ||
name = "config" | ||
mountPath = "/app/config" | ||
}] | ||
} | ||
expected: Container = _config | {name = 1} | ||
|
||
config = Config {} |
6 changes: 6 additions & 0 deletions
6
test/grammar/types/union_expr/union_expr_fail_1/stderr.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error[E2G22]: TypeError | ||
--> ${CWD}/main.k:14:38 | ||
| | ||
14 | expected: Container = _config | {name = 1} | ||
| ^ expected str, got int(1) | ||
| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
schema Container: | ||
name: str | ||
image: str | ||
volumeMounts: [{str:}] | ||
|
||
schema Config: | ||
_config = { | ||
name = 1 | ||
image = "test/test-container:test-cluster" | ||
volumeMounts = [{ | ||
name = "config" | ||
mountPath = "/app/config" | ||
}] | ||
} | ||
expected: Container = _config | {} | ||
|
||
config = Config {} |
6 changes: 6 additions & 0 deletions
6
test/grammar/types/union_expr/union_expr_fail_2/stderr.golden
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
error[E3M38]: EvaluationError | ||
--> ${CWD}/main.k:2:1 | ||
| | ||
2 | name: str | ||
| expect str, got int | ||
| |