openshift-online / maestro

Maestro Service Repo
Apache License 2.0
8 stars 15 forks source link

support to build grpc source work client with maestro restful api #122

Closed skeeey closed 2 weeks ago

skeeey commented 2 weeks ago

ref: https://github.com/openshift-online/maestro/issues/104

skeeey commented 2 weeks ago

make test OCM_ENV=testing gotestsum --jsonfile-timing-events=/home/cloud-user/go/src/github.com/openshift-online/maestro/unit-test-results.json --format short-verbose -- -p 1 -v \ ./pkg/... \ ./cmd/... PASS pkg/api.TestDecodeManifestBundle/empty (0.00s) PASS pkg/api.TestDecodeManifestBundle/valid (0.00s) PASS pkg/api.TestDecodeManifestBundle (0.00s) PASS pkg/api.TestDecodeManifestBundleToObjects/empty (0.00s) PASS pkg/api.TestDecodeManifestBundleToObjects/valid (0.00s) PASS pkg/api.TestDecodeManifestBundleToObjects (0.00s) PASS pkg/api.TestDecodeBundleStatus/empty (0.00s) PASS pkg/api.TestDecodeBundleStatus/valid (0.00s) PASS pkg/api.TestDecodeBundleStatus (0.00s) PASS pkg/api.TestEncodeManifest/empty (0.00s) PASS pkg/api.TestEncodeManifest/valid (0.00s) PASS pkg/api.TestEncodeManifest/valid#01 (0.00s) PASS pkg/api.TestEncodeManifest (0.00s) PASS pkg/api.TestDecodeManifest/empty (0.00s) PASS pkg/api.TestDecodeManifest/valid (0.00s) PASS pkg/api.TestDecodeManifest (0.00s) PASS pkg/api.TestDecodeStatus/empty (0.00s) PASS pkg/api.TestDecodeStatus/valid (0.00s) PASS pkg/api.TestDecodeStatus (0.00s) PASS pkg/api (cached) EMPTY pkg/api/openapi EMPTY pkg/api/presenters EMPTY pkg/auth EMPTY pkg/client/cloudevents PASS pkg/client/cloudevents/grpcsource.TestToManifestWork/covert_a_resourcebundle-_has_empty_fields (0.00s) PASS pkg/client/cloudevents/grpcsource.TestToManifestWork/covert_a_resource_bundle (0.00s) PASS pkg/client/cloudevents/grpcsource.TestToManifestWork (0.00s) PASS pkg/client/cloudevents/grpcsource (cached) EMPTY pkg/client/ocm PASS pkg/config.TestConfigReadStringFile (0.00s) PASS pkg/config.TestConfigReadIntFile (0.00s) PASS pkg/config.TestConfigReadBoolFile (0.00s) PASS pkg/config.TestConfigReadQuotedFile (0.00s) PASS pkg/config (cached) EMPTY pkg/constants PASS pkg/controllers.TestControllerFramework (0.00s) PASS pkg/controllers (cached) EMPTY pkg/dao EMPTY pkg/dao/mocks EMPTY pkg/db EMPTY pkg/db/db_context EMPTY pkg/db/db_session EMPTY pkg/db/migrations EMPTY pkg/db/mocks EMPTY pkg/db/transaction EMPTY pkg/dispatcher PASS pkg/errors.TestErrorFormatting (0.00s) PASS pkg/errors.TestErrorFind (0.00s) PASS pkg/errors (cached) EMPTY pkg/event EMPTY pkg/handlers (cached) EMPTY pkg/logger PASS pkg/services.TestSQLTranslation (0.01s) PASS pkg/services.TestResourceFindByConsumerID (0.00s) PASS pkg/services.TestCreateInvalidResource (0.00s) PASS pkg/services.TestValidateConsumer/validated (0.00s) PASS pkg/services.TestValidateConsumer/wrong_name (0.00s) PASS pkg/services.TestValidateConsumer/max_length (0.00s) PASS pkg/services.TestValidateConsumer (0.00s) PASS pkg/services.TestValidateResourceName/validated (0.00s) PASS pkg/services.TestValidateResourceName/wrong_name (0.00s) PASS pkg/services.TestValidateResourceName/max_length (0.00s) PASS pkg/services.TestValidateResourceName (0.00s) PASS pkg/services.TestValidateNewManifest/validated_single_manifest (0.00s) PASS pkg/services.TestValidateNewManifest/validated_bundle_manifest (0.00s) PASS pkg/services.TestValidateNewManifest/invalidated_single_manifest (0.00s) PASS pkg/services.TestValidateNewManifest/invalidated_bundle_manifest (0.00s) PASS pkg/services.TestValidateNewManifest/invalidated_resource_type (0.00s) PASS pkg/services.TestValidateNewManifest (0.00s) PASS pkg/services.TestValidateNewObject/validated (0.00s) PASS pkg/services.TestValidateNewObject/no_apiVersion (0.00s) PASS pkg/services.TestValidateNewObject/no_kind (0.00s) PASS pkg/services.TestValidateNewObject/no_name (0.00s) PASS pkg/services.TestValidateNewObject/has_generate_name (0.00s) PASS pkg/services.TestValidateNewObject/has_resource_version (0.00s) PASS pkg/services.TestValidateNewObject/has_deletion_grace_period_seconds (0.00s) PASS pkg/services.TestValidateNewObject/wrong_namespace (0.00s) PASS pkg/services.TestValidateNewObject/wrong_apiversion(no_version) (0.00s) PASS pkg/services.TestValidateNewObject/wrong_apiversion(no_version)#01 (0.00s) PASS pkg/services.TestValidateNewObject/wrong_api_version (0.00s) PASS pkg/services.TestValidateNewObject (0.00s) PASS pkg/services.TestValidateUpdateManifest/validated_single_manifest (0.00s) PASS pkg/services.TestValidateUpdateManifest/validated_bundle_manifest (0.00s) PASS pkg/services.TestValidateUpdateManifest/invalidated_single_manifest (0.00s) PASS pkg/services.TestValidateUpdateManifest/invalidated_bundle_manifest (0.00s) PASS pkg/services.TestValidateUpdateManifest/invalidated_resource_type (0.00s) PASS pkg/services.TestValidateUpdateManifest (0.00s) PASS pkg/services.TestValidateUpdateObject/validated (0.00s) PASS pkg/services.TestValidateUpdateObject/apiVersion_mismatch (0.00s) PASS pkg/services.TestValidateUpdateObject/kind_mismatch (0.00s) PASS pkg/services.TestValidateUpdateObject/name_mismatch (0.00s) PASS pkg/services.TestValidateUpdateObject/namespace_mismatch (0.00s) PASS pkg/services.TestValidateUpdateObject (0.00s) PASS pkg/services EMPTY pkg/util EMPTY cmd/maestro EMPTY cmd/maestro/agent PASS cmd/maestro/environments.TestLoadServices (0.27s) PASS cmd/maestro/environments EMPTY cmd/maestro/migrate EMPTY cmd/maestro/servecmd EMPTY cmd/maestro/server EMPTY cmd/maestro/server/logging

DONE 71 tests in 24.262s

skeeey commented 2 weeks ago

make test-integration OCM_ENV=testing gotestsum --jsonfile-timing-events=/home/cloud-user/go/src/github.com/openshift-online/maestro/integration-test-results.json --format short-verbose -- -p 1 -ldflags -s -v -timeout 1h \ ./test/integration I0611 22:39:52.893630 230864 framework.go:75] Initializing testing environment I0611 22:39:53.180754 230864 framework.go:160] Using Mock OCM Authz Client I0611 22:39:53.182378 230864 framework.go:213] Disabling Sentry error reporting I0611 22:39:53.187651 230864 event.go:75] Starting event broadcaster I0611 22:39:53.190398 230864 grpc_server.go:73] Serving gRPC service without TLS at 8090 PASS test/integration.TestConsumerGet (0.07s) PASS test/integration.TestConsumerPost (0.04s) PASS test/integration.TestConsumerPatch (0.07s) PASS test/integration.TestConsumerPaging (0.08s) PASS test/integration.TestControllerRacing (1.38s) PASS test/integration.TestControllerReconcile (1.14s) PASS test/integration.TestControllerSync (1.04s) PASS test/integration.TestPulseServer (7.06s) PASS test/integration.TestResourceGet (0.05s) PASS test/integration.TestResourcePost (2.04s) PASS test/integration.TestResourcePostWithoutName (0.05s) PASS test/integration.TestResourcePostWithName (0.04s) PASS test/integration.TestResourcePatch (0.07s) PASS test/integration.TestResourcePaging (0.20s) PASS test/integration.TestResourceListSearch (0.12s) PASS test/integration.TestResourceBundleGet (0.05s) PASS test/integration.TestResourceBundleListSearch (0.19s) PASS test/integration.TestUpdateResourceWithRacingRequests (3.13s) PASS test/integration.TestResourceFromGRPC (5.11s) PASS test/integration.TestResourceBundleFromGRPC (3.06s) I0611 22:40:18.206621 230864 api_server.go:157] Web server terminated E0611 22:40:18.207419 230864 baseclient.go:88] the cloudevents client is disconnected, read tcp 127.0.0.1:40934->127.0.0.1:1883: use of closed network connection I0611 22:40:18.208141 230864 healthcheck_server.go:60] HealthCheck server terminated PASS test/integration

DONE 20 tests in 27.570s

skeeey commented 2 weeks ago

/cc @qiujian16 @morvencao @clyang82

clyang82 commented 2 weeks ago

/ok-to-test