Skip to content

Commit

Permalink
Merge branch 'dev' into dev-clever
Browse files Browse the repository at this point in the history
  • Loading branch information
da-ekchajzer committed Dec 11, 2024
2 parents e069963 + 2f189b8 commit 808f25f
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions boaviztapi/data/archetypes/server.csv
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,4 @@ scw_pop2hm.base,Scaleway,rack,2,32,,AMD EPYC 7543,128,16,32,2,234,0,0,0,,0,2,0,5
scw_pro2.base,Scaleway,rack,2,32,,AMD EPYC 7543,128,24,32,2,468,0,0,0,,0,2,0,50;0;100,1,52560,0.33;0.2;0.6,
scw_renders.base,Scaleway,rack,2,20,,Intel Xeon Gold 6148,40,12,32,2,3750,0,0,8,Nvidia Tesla P100,24,4,0,50;0;100,1,52560,0.33;0.2;0.6,
scw_stardust1.base,Scaleway,rack,1,16,,AMD EPYC 7281,64,8,32,5,976,0,0,0,,0,2,0,50;0;100,1,52560,0.33;0.2;0.6,
platform_aws_t4g,AWS,rack,1,,,Annapurna Labs Graviton2,,8,32,0,0,0,0,0,,0,2;2;2,2.99;1;5,50;0;100,1,35040,0.33;0.2;0.6,RAM configuration was not verified
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "boaviztapi"
version = "1.3.3"
version = "1.3.4"
description = "An API to access Boavizta's methodologies and footprint reference data"
authors = []
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions tests/api/test_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,3 +991,4 @@ async def test_empty_usage_scw_dev1_l():
)

await test.check_result()

35 changes: 35 additions & 0 deletions tests/unit/test_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import csv
import os.path

import pytest

cloud_path = os.path.join(os.path.dirname(__file__), "../../boaviztapi/data/archetypes/cloud/")
providers_path = os.path.join(os.path.dirname(__file__),"../../boaviztapi/data/archetypes/cloud/providers.csv")
servers_patch = os.path.join(os.path.dirname(__file__),"../../boaviztapi/data/archetypes/server.csv")

@pytest.fixture
def providers():
with open(providers_path, 'r') as f:
reader = csv.DictReader(f)
return [row['provider.name'] for row in reader]

@pytest.fixture
def valid_platforms():
with open(servers_patch, 'r') as f:
reader = csv.DictReader(f)
return {row['id'] for row in reader}


def test_platform_exists_in_server_csv(providers, valid_platforms):
for provider_name in providers:
provider_csv_path = f"{cloud_path}/{provider_name}.csv"

try:
with open(provider_csv_path, 'r') as f:
reader = csv.DictReader(f)
for row in reader:
platform = row.get('platform', '').strip()
if platform not in valid_platforms:
pytest.fail(f"Platform '{platform}' for provider '{provider_name}' not found in server.csv")
except FileNotFoundError:
pytest.fail(f"CSV file for provider '{provider_name}' not found: {provider_csv_path}")

0 comments on commit 808f25f

Please sign in to comment.