Skip to content

Commit 5a9a36b

Browse files
committed
update integrations, remove unit tests from integration target
1 parent 0b24745 commit 5a9a36b

File tree

3 files changed

+18
-8
lines changed

3 files changed

+18
-8
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fmt:
4646
check: errcheck vet fmt test-unit
4747

4848
.PHONY: integration
49-
integration: build
49+
integration: build_binary
5050
go test -v ./integration -args -namespace=`oc project -q` -executable=`pwd`/mobile
5151

5252
.PHONY: release

integration/client_crudl_test.go

+16-6
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ import (
88
)
99

1010
type MobileClientSpec struct {
11-
Name string
12-
ApiKey string
13-
ClientType string
11+
Name string
12+
ApiKey string
13+
ClientType string
14+
AppIdentifier string
1415
}
1516

1617
type MobileClientJson struct {
1718
Spec MobileClientSpec
1819
}
1920

20-
func ValidMobileClientJson(name string, clientType string) func(output []byte, err error) ValidationResult {
21+
func ValidMobileClientJson(name, clientType, appIdentifier string) func(output []byte, err error) ValidationResult {
2122
return func(output []byte, err error) ValidationResult {
2223
var parsed MobileClientJson
2324
if err := json.Unmarshal([]byte(output), &parsed); err != nil {
@@ -31,6 +32,14 @@ func ValidMobileClientJson(name string, clientType string) func(output []byte, e
3132
Output: output,
3233
}
3334
}
35+
if parsed.Spec.AppIdentifier != appIdentifier {
36+
return ValidationResult{
37+
Success: false,
38+
Message: []string{fmt.Sprintf("Expected the AppIdentifier to be %s, but got %s", appIdentifier, parsed.Spec.AppIdentifier)},
39+
Error: err,
40+
Output: output,
41+
}
42+
}
3443
if parsed.Spec.Name != name {
3544
return ValidationResult{
3645
Success: false,
@@ -52,18 +61,19 @@ func TestClientJson(t *testing.T) {
5261
}
5362

5463
name := fmt.Sprintf("%s-mobile-crud-test-entity", *prefix)
64+
appIdentifier := "my.app.org"
5565
m := ValidatedCmd(*executable, fmt.Sprintf("--namespace=%s", *namespace), "-o=json")
5666
o := ValidatedCmd("oc", fmt.Sprintf("--namespace=%s", *namespace), "-o=json")
5767
for _, clientType := range clientTypes {
5868
t.Run(clientType, func(t *testing.T) {
5969
expectedId := strings.ToLower(fmt.Sprintf("%s-%s", name, clientType))
6070

6171
notExists := All(IsErr, ValidRegex(fmt.Sprintf(".*\"%s\" not found.*", expectedId)))
62-
exists := All(NoErr, ValidMobileClientJson(name, clientType))
72+
exists := All(NoErr, ValidMobileClientJson(name, clientType, appIdentifier))
6373

6474
m.Args("get", "client", expectedId).Should(notExists).Run().Test(t)
6575
o.Args("get", "mobileclient", expectedId).Should(notExists).Run().Test(t)
66-
m.Args("create", "client", name, clientType).Should(exists).Run().Test(t)
76+
m.Args("create", "client", name, clientType, appIdentifier).Should(exists).Run().Test(t)
6777
m.Args("get", "client", expectedId).Should(exists).Run().Test(t)
6878
o.Args("get", "mobileclient", expectedId).Should(exists).Run().Test(t)
6979
m.Args("delete", "client", expectedId).Should(NoErr).Run().Test(t)
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"metadata":{},"items":[{"metadata":{"name":"1522a4d0e2fbf86a26cbe096eb1b6b2d","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/1522a4d0e2fbf86a26cbe096eb1b6b2d","uid":"f245ebb9-fb89-11e7-b96a-0242ac110002","resourceVersion":"30","creationTimestamp":"2018-01-17T13:25:55Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-unifiedpush-apb","externalID":"1522a4d0e2fbf86a26cbe096eb1b6b2d","description":"AeroGear UnifiedPush Server","bindable":true,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"dependencies":["MySQL:55"],"displayName":"AeroGear UPS","documentationUrl":"https://aerogear.org/push","imageUrl":"https://pbs.twimg.com/profile_images/1794440005/aerogear_icon-1_400x400.png","providerDisplayName":"Red Hat, Inc.","serviceName":"ups"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"2b825339e8d685a78476621a252beea8","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/2b825339e8d685a78476621a252beea8","uid":"f2661c87-fb89-11e7-b96a-0242ac110002","resourceVersion":"37","creationTimestamp":"2018-01-17T13:25:55Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-3scale-apb","externalID":"2b825339e8d685a78476621a252beea8","description":"Unlock the power of your APIs. This will deploy Apicast to your Openshift cluster and connect it to a dedicated Redis. For this to function correctly it needs to be configured with a token and domain for the account it should pull it's configuration values from (usually in 3scale.net).\nYou can create an account with 3scale.net here: https://www.3scale.net/signup/\n","bindable":true,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"3Scale","documentationUrl":"https://www.3scale.net/api-management/interactive-api-documentation/","imageUrl":"https://avatars1.githubusercontent.com/u/21415?s=200\u0026v=4","providerDisplayName":"Red Hat, Inc.","serviceName":"3scale"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"9623d53183cc78619f888ea8499c678e","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/9623d53183cc78619f888ea8499c678e","uid":"f2473a79-fb89-11e7-b96a-0242ac110002","resourceVersion":"32","creationTimestamp":"2018-01-17T13:25:55Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-metrics-apb","externalID":"9623d53183cc78619f888ea8499c678e","description":"Installs a metrics service based on Prometheus and Grafana","bindable":false,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"Metrics","documentationUrl":"https://prometheus.io/docs/introduction/overview/","imageUrl":"https://avatars1.githubusercontent.com/u/3380462?s=200\u0026v=4","providerDisplayName":"Red Hat, Inc.","serviceName":"prometheus"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"a0c0c2478554458d5c77abc95f0473a3","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/a0c0c2478554458d5c77abc95f0473a3","uid":"f2469a3a-fb89-11e7-b96a-0242ac110002","resourceVersion":"31","creationTimestamp":"2018-01-17T13:25:55Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-aerogear-digger-apb","externalID":"a0c0c2478554458d5c77abc95f0473a3","description":"Mobile CI/CD service that integrates with Jenkins Pipelines to test and build your mobile binaries.","bindable":false,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"Mobile CI/CD","documentationUrl":"https://aerogear.org/digger/","imageUrl":"https://aerogear.org/img/aerogeardigger_icon_32px_cropped.png","longDescription":"To use the Mobile CI/CD service you must first agree to the Android SDK License Agreement. By checking this box you are agreeing to the Android Software Development Kit License agreement which can be read at the following URL: https://developer.android.com/studio/terms.html\n\n. If the box is not checked the installer will take no action.","providerDisplayName":"Red Hat, Inc.","serviceName":"aerogear-digger-apb"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"b95513950bb3f132de25d58fb75f8dca","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/b95513950bb3f132de25d58fb75f8dca","uid":"f2499c77-fb89-11e7-b96a-0242ac110002","resourceVersion":"36","creationTimestamp":"2018-01-17T13:25:55Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-keycloak-apb","externalID":"b95513950bb3f132de25d58fb75f8dca","description":"Keycloak - Open Source Identity and Access Management","bindable":true,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"dependencies":["Postgresql:9.5"],"displayName":"Keycloak","documentationUrl":"http://www.keycloak.org/documentation.html","imageUrl":"https://pbs.twimg.com/profile_images/702119821979344897/oAC05cEB_400x400.png","providerDisplayName":"Red Hat, Inc.","serviceName":"keycloak"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"c57e94c36c1e7f6bb41cf7c589d9eb08","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/c57e94c36c1e7f6bb41cf7c589d9eb08","uid":"f28461c0-fb89-11e7-b96a-0242ac110002","resourceVersion":"38","creationTimestamp":"2018-01-17T13:25:55Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-fh-sync-server-apb","externalID":"c57e94c36c1e7f6bb41cf7c589d9eb08","description":"The FeedHenry Sync Server APB","bindable":false,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"FeedHenry Sync Server","documentationUrl":"http://feedhenry.org/projects/#data-synchronization","imageUrl":"https://avatars3.githubusercontent.com/u/772226?s=200\u0026v=4","integrations":"keycloak,apiKeys","providerDisplayName":"Red Hat, Inc.","serviceName":"fh-sync-server"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}}]}
1+
{"metadata":{},"items":[{"metadata":{"name":"1522a4d0e2fbf86a26cbe096eb1b6b2d","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/1522a4d0e2fbf86a26cbe096eb1b6b2d","uid":"470ef9e9-01cf-11e8-a8d5-0242ac110002","resourceVersion":"3877","creationTimestamp":"2018-01-25T12:57:19Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-unifiedpush-apb","externalID":"1522a4d0e2fbf86a26cbe096eb1b6b2d","description":"AeroGear UnifiedPush Server","bindable":true,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"dependencies":["MySQL:55"],"displayName":"AeroGear UPS","documentationUrl":"https://aerogear.org/push","imageUrl":"https://pbs.twimg.com/profile_images/1794440005/aerogear_icon-1_400x400.png","providerDisplayName":"Red Hat, Inc.","serviceName":"ups"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"2b825339e8d685a78476621a252beea8","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/2b825339e8d685a78476621a252beea8","uid":"470ba629-01cf-11e8-a8d5-0242ac110002","resourceVersion":"3873","creationTimestamp":"2018-01-25T12:57:19Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-3scale-apb","externalID":"2b825339e8d685a78476621a252beea8","description":"Unlock the power of your APIs. This will deploy Apicast to your Openshift cluster and connect it to a dedicated Redis. For this to function correctly it needs to be configured with a token and domain for the account it should pull it's configuration values from (usually in 3scale.net).\nYou can create an account with 3scale.net here: https://www.3scale.net/signup/\n","bindable":true,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"3Scale","documentationUrl":"https://www.3scale.net/api-management/interactive-api-documentation/","imageUrl":"https://avatars1.githubusercontent.com/u/21415?s=200\u0026v=4","providerDisplayName":"Red Hat, Inc.","serviceName":"3scale"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"9623d53183cc78619f888ea8499c678e","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/9623d53183cc78619f888ea8499c678e","uid":"470fa7f2-01cf-11e8-a8d5-0242ac110002","resourceVersion":"3878","creationTimestamp":"2018-01-25T12:57:19Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-metrics-apb","externalID":"9623d53183cc78619f888ea8499c678e","description":"Installs a metrics service based on Prometheus and Grafana","bindable":false,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"Metrics","documentationUrl":"https://prometheus.io/docs/introduction/overview/","imageUrl":"https://avatars1.githubusercontent.com/u/3380462?s=200\u0026v=4","providerDisplayName":"Red Hat, Inc.","serviceName":"prometheus"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"a0c0c2478554458d5c77abc95f0473a3","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/a0c0c2478554458d5c77abc95f0473a3","uid":"470c4ca8-01cf-11e8-a8d5-0242ac110002","resourceVersion":"3874","creationTimestamp":"2018-01-25T12:57:19Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-aerogear-digger-apb","externalID":"a0c0c2478554458d5c77abc95f0473a3","description":"Mobile CI/CD service that integrates with Jenkins Pipelines to test and build your mobile binaries.","bindable":false,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"displayName":"Mobile CI/CD","documentationUrl":"https://aerogear.org/digger/","imageUrl":"https://aerogear.org/img/aerogeardigger_icon_32px_cropped.png","longDescription":"To use the Mobile CI/CD service you must first agree to the Android SDK License Agreement. By checking this box you are agreeing to the Android Software Development Kit License agreement which can be read at the following URL: https://developer.android.com/studio/terms.html\n\n. If the box is not checked the installer will take no action.","providerDisplayName":"Red Hat, Inc.","serviceName":"aerogear-digger-apb"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"b95513950bb3f132de25d58fb75f8dca","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/b95513950bb3f132de25d58fb75f8dca","uid":"470cecdf-01cf-11e8-a8d5-0242ac110002","resourceVersion":"3875","creationTimestamp":"2018-01-25T12:57:19Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-keycloak-apb","externalID":"b95513950bb3f132de25d58fb75f8dca","description":"Keycloak - Open Source Identity and Access Management","bindable":true,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"dependencies":["Postgresql:9.5"],"displayName":"Keycloak","documentationUrl":"http://www.keycloak.org/documentation.html","imageUrl":"https://pbs.twimg.com/profile_images/702119821979344897/oAC05cEB_400x400.png","providerDisplayName":"Red Hat, Inc.","serviceName":"keycloak"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}},{"metadata":{"name":"c57e94c36c1e7f6bb41cf7c589d9eb08","selfLink":"/apis/servicecatalog.k8s.io/v1beta1/clusterserviceclasses/c57e94c36c1e7f6bb41cf7c589d9eb08","uid":"470e546c-01cf-11e8-a8d5-0242ac110002","resourceVersion":"3876","creationTimestamp":"2018-01-25T12:57:19Z"},"spec":{"clusterServiceBrokerName":"ansible-service-broker","externalName":"dh-fh-sync-server-apb","externalID":"c57e94c36c1e7f6bb41cf7c589d9eb08","description":"The FeedHenry Sync Server APB","bindable":false,"binding_retrievable":false,"planUpdatable":false,"externalMetadata":{"console.openshift.io/iconClass":"font-icon icon-nodejs","displayName":"FeedHenry Sync Server","integrations":"keycloak,apiKeys","serviceName":"fh-sync-server"},"tags":["mobile-service"]},"status":{"removedFromBrokerCatalog":false}}]}

0 commit comments

Comments
 (0)