mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-11-08 23:06:09 -05:00
fix tests
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
b9077150f8
commit
c21d2acd8b
5 changed files with 19 additions and 37 deletions
|
|
@ -39,7 +39,6 @@ go_deps.from_file(go_work = "//:go.work")
|
||||||
use_repo(
|
use_repo(
|
||||||
go_deps,
|
go_deps,
|
||||||
"cat_dario_mergo",
|
"cat_dario_mergo",
|
||||||
"com_github_aws_aws_sdk_go",
|
|
||||||
"com_github_aws_aws_sdk_go_v2",
|
"com_github_aws_aws_sdk_go_v2",
|
||||||
"com_github_aws_aws_sdk_go_v2_config",
|
"com_github_aws_aws_sdk_go_v2_config",
|
||||||
"com_github_aws_aws_sdk_go_v2_credentials",
|
"com_github_aws_aws_sdk_go_v2_credentials",
|
||||||
|
|
|
||||||
|
|
@ -33,8 +33,8 @@ func TestBackupCRDs(t *testing.T) {
|
||||||
}{
|
}{
|
||||||
"success": {
|
"success": {
|
||||||
upgradeID: "1234",
|
upgradeID: "1234",
|
||||||
crd: "apiVersion: \nkind: \nmetadata:\n name: foobar\n creationTimestamp: null\nspec:\n group: \"\"\n names:\n kind: \"somename\"\n plural: \"somenames\"\n scope: \"\"\n versions: null\nstatus:\n acceptedNames:\n kind: \"\"\n plural: \"\"\n conditions: null\n storedVersions: null\n",
|
crd: "apiVersion: \nkind: \nmetadata:\n name: foobar\nspec:\n group: \"\"\n names:\n kind: \"somename\"\n plural: \"somenames\"\n scope: \"\"\n versions: null\nstatus:\n acceptedNames:\n kind: \"\"\n plural: \"\"\n conditions: null\n storedVersions: null\n",
|
||||||
expectedFile: "apiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition\nmetadata:\n name: foobar\n creationTimestamp: null\nspec:\n group: \"\"\n names:\n kind: \"somename\"\n plural: \"somenames\"\n scope: \"\"\n versions: null\nstatus:\n acceptedNames:\n kind: \"\"\n plural: \"\"\n conditions: null\n storedVersions: null\n",
|
expectedFile: "apiVersion: apiextensions.k8s.io/v1\nkind: CustomResourceDefinition\nmetadata:\n name: foobar\nspec:\n group: \"\"\n names:\n kind: \"somename\"\n plural: \"somenames\"\n scope: \"\"\n versions: null\nstatus:\n acceptedNames:\n kind: \"\"\n plural: \"\"\n conditions: null\n storedVersions: null\n",
|
||||||
},
|
},
|
||||||
"api request fails": {
|
"api request fails": {
|
||||||
upgradeID: "1234",
|
upgradeID: "1234",
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,12 @@ func TestConfigMaps(t *testing.T) {
|
||||||
data:
|
data:
|
||||||
key: value1
|
key: value1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
key: value2
|
key: value2
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`, string(data))
|
`, string(data))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,7 @@ func TestMarshalK8SResources(t *testing.T) {
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
"Multiple fields are correctly encoded": {
|
"Multiple fields are correctly encoded": {
|
||||||
|
|
@ -73,15 +72,13 @@ metadata:
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
key: dmFsdWU=
|
key: dmFsdWU=
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
"Non-pointer is detected": {
|
"Non-pointer is detected": {
|
||||||
|
|
@ -134,8 +131,7 @@ func TestUnmarshalK8SResources(t *testing.T) {
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
into: &struct {
|
into: &struct {
|
||||||
ConfigMap k8s.ConfigMap
|
ConfigMap k8s.ConfigMap
|
||||||
|
|
@ -159,15 +155,13 @@ metadata:
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
key: dmFsdWU=
|
key: dmFsdWU=
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
into: &struct {
|
into: &struct {
|
||||||
ConfigMap k8s.ConfigMap
|
ConfigMap k8s.ConfigMap
|
||||||
|
|
@ -202,15 +196,13 @@ metadata:
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
key: dmFsdWU=
|
key: dmFsdWU=
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
into: &struct {
|
into: &struct {
|
||||||
ConfigMap k8s.ConfigMap
|
ConfigMap k8s.ConfigMap
|
||||||
|
|
@ -238,8 +230,7 @@ metadata:
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
into: &struct {
|
into: &struct {
|
||||||
String string
|
String string
|
||||||
|
|
@ -251,8 +242,7 @@ metadata:
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
into: &struct {
|
into: &struct {
|
||||||
Secret k8s.Secret
|
Secret k8s.Secret
|
||||||
|
|
@ -301,8 +291,7 @@ func TestMarshalK8SResourcesList(t *testing.T) {
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
"Multiple fields are correctly encoded": {
|
"Multiple fields are correctly encoded": {
|
||||||
|
|
@ -330,15 +319,13 @@ metadata:
|
||||||
data:
|
data:
|
||||||
key: value
|
key: value
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
key: dmFsdWU=
|
key: dmFsdWU=
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
"Nil resource pointer is encodes": {
|
"Nil resource pointer is encodes": {
|
||||||
|
|
|
||||||
|
|
@ -42,14 +42,12 @@ func TestSecrets(t *testing.T) {
|
||||||
data:
|
data:
|
||||||
key: dmFsdWUx
|
key: dmFsdWUx
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
data:
|
data:
|
||||||
key: dmFsdWUy
|
key: dmFsdWUy
|
||||||
kind: Secret
|
kind: Secret
|
||||||
metadata:
|
metadata: {}
|
||||||
creationTimestamp: null
|
|
||||||
`, string(data))
|
`, string(data))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue