Open chivalryq opened 1 year ago
@chivalryq can you please tell me the location to where the test case is to be made
Please provide some clues about how to verify the consistency between cue and go. Thank you.
Hi @rhzx3519 @swastik959 This is a kinda tricky problem. There are two ways to do that.
Considering the generating problems I think it's easier take the second method to implement this. You can add test in apis/core.oam.dev/v1alpha1
Hi @rhzx3519 @swastik959 This is a kinda tricky problem. There are two ways to do that.
- Make one is generated from another.
- Use some mock data to test it fits both the Go struct and CUE schema.
Considering the generating problems I think it's easier take the second method to implement this. You can add test in
apis/core.oam.dev/v1alpha1
Yep, I agree the second method would be an easy way to implement. I'll take this issue.
@rhzx3519 sorry but I have already started working on this issue
@swastik959 Okay, I'll look for other issues.
@chivalryq I have tried to make a example test case please check if this is what you want
For now we have some policy spec in golang stored in
apis/core.oam.dev/v1alpha1
. The corresponding CUE spec are stored invela-templates/definitions/internal/policy
.Although these files are trying to describe the same specifications like
apis/core.oam.dev/v1alpha1/readonly_policy_types.go
andvela-templates/definitions/internal/policy/read-only.cue
, there is no source of truth. None of them is generated from each other. So we need some test cases to check if they are consistent.we need some test case to cover
Originally posted by @wonderflow in https://github.com/kubevela/kubevela/pull/5498#pullrequestreview-1296976654