-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #636 from sapcc/api_test_fix
Add test cases to prevent future API breaks on AZ separated changes
- Loading branch information
Showing
9 changed files
with
148 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"cluster": { | ||
"id": "current", | ||
"services": [ | ||
{ | ||
"type": "shared", | ||
"area": "shared", | ||
"resources": [ | ||
{ | ||
"name": "capacity_portion", | ||
"unit": "B", | ||
"category": "portion", | ||
"per_az": { | ||
"az-one": { | ||
"capacity": 0, | ||
"projects_usage": 1, | ||
"uncommitted_usage": 1 | ||
}, | ||
"az-two": { | ||
"capacity": 0, | ||
"projects_usage": 1, | ||
"uncommitted_usage": 1 | ||
} | ||
}, | ||
"usage": 2 | ||
} | ||
], | ||
"max_scraped_at": 22, | ||
"min_scraped_at": 22 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"domains": [ | ||
{ | ||
"id": "uuid-for-germany", | ||
"name": "germany", | ||
"services": [ | ||
{ | ||
"type": "shared", | ||
"area": "shared", | ||
"resources": [ | ||
{ | ||
"name": "capacity_portion", | ||
"unit": "B", | ||
"category": "portion", | ||
"per_az": { | ||
"az-one": { | ||
"quota": 5, | ||
"usage": 1, | ||
"uncommitted_usage": 1 | ||
}, | ||
"az-two": { | ||
"quota": 5, | ||
"usage": 1, | ||
"uncommitted_usage": 1 | ||
} | ||
}, | ||
"usage": 2 | ||
} | ||
], | ||
"max_scraped_at": 22, | ||
"min_scraped_at": 22 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{ | ||
"projects": [ | ||
{ | ||
"id": "uuid-for-berlin", | ||
"name": "berlin", | ||
"parent_id": "uuid-for-germany", | ||
"services": [ | ||
{ | ||
"type": "shared", | ||
"area": "shared", | ||
"resources": [ | ||
{ | ||
"name": "capacity_portion", | ||
"unit": "B", | ||
"category": "portion", | ||
"per_az": { | ||
"az-one": { | ||
"quota": 5, | ||
"usage": 1 | ||
}, | ||
"az-two": { | ||
"quota": 5, | ||
"usage": 1 | ||
} | ||
}, | ||
"usage": 2 | ||
} | ||
], | ||
"scraped_at": 22 | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
CREATE OR REPLACE FUNCTION unix(i integer) RETURNS timestamp AS $$ SELECT TO_TIMESTAMP(i) AT TIME ZONE 'Etc/UTC' $$ LANGUAGE SQL; | ||
|
||
INSERT INTO domains (id, name, uuid) VALUES (1, 'germany', 'uuid-for-germany'); | ||
|
||
INSERT INTO projects (id, domain_id, name, uuid, parent_uuid) VALUES (1, 1, 'berlin', 'uuid-for-berlin', 'uuid-for-germany'); | ||
|
||
INSERT INTO project_services (id, project_id, type, scraped_at, rates_scraped_at, checked_at, rates_checked_at) VALUES (1, 1, 'shared', UNIX(22), UNIX(23), UNIX(22), UNIX(23)); | ||
|
||
INSERT INTO project_resources (id, service_id, name, quota, backend_quota) VALUES (1, 1, 'capacity_portion', NULL, NULL); | ||
|
||
-- AZ separated resource does not include any az. | ||
INSERT INTO project_az_resources (id, resource_id, az, backend_quota, quota, usage, physical_usage, subresources) VALUES (1, 1, 'az-one', 5, 5, 1, NULL, ''); | ||
INSERT INTO project_az_resources (id, resource_id, az, backend_quota, quota, usage, physical_usage, subresources) VALUES (2, 1, 'az-two', 5, 5, 1, NULL, ''); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters