diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-31 11:29:56 +0100 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2017-10-31 12:23:31 +0100 |
commit | 84f5aaa729d6286252602800a1f9e1bf1e5b47d3 (patch) | |
tree | c144d77c478862303ac12cded4415f597cb8779b /spec | |
parent | 6d462cea77508e407995c58b0ae581edefa74d22 (diff) | |
download | gitlab-ce-84f5aaa729d6286252602800a1f9e1bf1e5b47d3.tar.gz |
WIP: mock cluster apps status API
Diffstat (limited to 'spec')
-rw-r--r-- | spec/fixtures/api/schemas/cluster_status.json | 35 | ||||
-rw-r--r-- | spec/serializers/cluster_entity_spec.rb | 4 | ||||
-rw-r--r-- | spec/serializers/cluster_serializer_spec.rb | 2 |
3 files changed, 38 insertions, 3 deletions
diff --git a/spec/fixtures/api/schemas/cluster_status.json b/spec/fixtures/api/schemas/cluster_status.json index 1f255a17881..451ea50f0f9 100644 --- a/spec/fixtures/api/schemas/cluster_status.json +++ b/spec/fixtures/api/schemas/cluster_status.json @@ -5,7 +5,38 @@ ], "properties" : { "status": { "type": "string" }, - "status_reason": { "type": ["string", "null"] } + "status_reason": { "type": ["string", "null"] }, + "applications": { "$ref": "#/definitions/applications" } }, - "additionalProperties": false + "additionalProperties": false, + "definitions": { + "applications": { + "type": "object", + "additionalProperties": false, + "properties" : { + "helm": { "$ref": "#/definitions/app_status" }, + "runner": { "$ref": "#/definitions/app_status" }, + "ingress": { "$ref": "#/definitions/app_status" }, + "prometheus": { "$ref": "#/definitions/app_status" } + } + }, + "app_status": { + "type": "object", + "additionalProperties": false, + "properties" : { + "status": { + "type": { + "enum": [ + "installable", + "installing", + "installed", + "error" + ] + } + }, + "status_reason": { "type": ["string", "null"] } + }, + "required" : [ "status" ] + } + } } diff --git a/spec/serializers/cluster_entity_spec.rb b/spec/serializers/cluster_entity_spec.rb index 2c7f49974f1..ec02af4b620 100644 --- a/spec/serializers/cluster_entity_spec.rb +++ b/spec/serializers/cluster_entity_spec.rb @@ -18,5 +18,9 @@ describe ClusterEntity do it 'contains status reason' do expect(subject[:status_reason]).to eq('general error') end + + it 'contains applications' do + expect(subject[:applications]).to eq({}) + end end end diff --git a/spec/serializers/cluster_serializer_spec.rb b/spec/serializers/cluster_serializer_spec.rb index 1ac6784d28f..44039327457 100644 --- a/spec/serializers/cluster_serializer_spec.rb +++ b/spec/serializers/cluster_serializer_spec.rb @@ -12,7 +12,7 @@ describe ClusterSerializer do let(:resource) { create(:gcp_cluster, :errored) } it 'serializes only status' do - expect(subject.keys).to contain_exactly(:status, :status_reason) + expect(subject.keys).to contain_exactly(:status, :status_reason, :applications) end end end |