forked from cerc-io/laconicd
Add e2e tests for gRPC requests and CLI commands (#13)
- Add E2E tests following pattern suggested in cosmos-sdk docs: https://docs.cosmos.network/v0.50/build/building-modules/testing#end-to-end-tests - Tests for gRPC requests - Tests for manually configured CLI commands - Add a CI workflow to run these E2E tests Reviewed-on: deep-stack/laconic2d#13 Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com> Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
record:
|
||||
attr1: value1
|
||||
attr2: value2
|
||||
link1:
|
||||
/: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||
link2:
|
||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
@@ -1,7 +0,0 @@
|
||||
record:
|
||||
type: GeneralRecord
|
||||
name: foo
|
||||
version: 1.0.0
|
||||
tags:
|
||||
- tagA
|
||||
- tagB
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
record:
|
||||
type: ServiceProviderRegistration
|
||||
bond_id: madeUpBondID
|
||||
laconic_id: madeUpLaconicID
|
||||
version: 1.0.0
|
||||
x500:
|
||||
common_name: cerc-io
|
||||
organization_unit: xyz
|
||||
organization_name: abc
|
||||
state_name: california
|
||||
country: US
|
||||
locality_name: local
|
||||
@@ -1,7 +0,0 @@
|
||||
record:
|
||||
type: WebsiteRegistrationRecord
|
||||
url: https://cerc.io
|
||||
repo_registration_record_cid: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
|
||||
build_artifact_cid: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
tls_cerc_cid: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.0.0
|
||||
@@ -37,9 +37,9 @@ func (kts *KeeperTestSuite) TestGrpcGetRecordLists() {
|
||||
|
||||
var recordId string
|
||||
examples := []string{
|
||||
"../../data/examples/service_provider_example.yml",
|
||||
"../../data/examples/website_registration_example.yml",
|
||||
"../../data/examples/general_record_example.yml",
|
||||
"../../../data/examples/service_provider_example.yml",
|
||||
"../../../data/examples/website_registration_example.yml",
|
||||
"../../../data/examples/general_record_example.yml",
|
||||
}
|
||||
testCases := []struct {
|
||||
msg string
|
||||
@@ -268,7 +268,7 @@ func (kts *KeeperTestSuite) TestGrpcGetRecordLists() {
|
||||
}
|
||||
|
||||
// Get the records by record id
|
||||
testCasesByBondID := []struct {
|
||||
testCasesByBondId := []struct {
|
||||
msg string
|
||||
req *types.QueryRecordsByBondIdRequest
|
||||
createRecord bool
|
||||
@@ -292,7 +292,7 @@ func (kts *KeeperTestSuite) TestGrpcGetRecordLists() {
|
||||
1,
|
||||
},
|
||||
}
|
||||
for _, test := range testCasesByBondID {
|
||||
for _, test := range testCasesByBondId {
|
||||
kts.Run(fmt.Sprintf("Case %s ", test.msg), func() {
|
||||
resp, err := queryClient.GetRecordsByBondId(context.Background(), test.req)
|
||||
|
||||
@@ -314,8 +314,8 @@ func (kts *KeeperTestSuite) TestGrpcQueryRegistryModuleBalance() {
|
||||
queryClient, ctx := kts.queryClient, kts.SdkCtx
|
||||
sr := kts.Require()
|
||||
examples := []string{
|
||||
"../../data/examples/service_provider_example.yml",
|
||||
"../../data/examples/website_registration_example.yml",
|
||||
"../../../data/examples/service_provider_example.yml",
|
||||
"../../../data/examples/website_registration_example.yml",
|
||||
}
|
||||
testCases := []struct {
|
||||
msg string
|
||||
|
||||
Reference in New Issue
Block a user