Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TestSelection to use Pydantic #64

Closed
raju-apple opened this issue Oct 19, 2023 · 2 comments · May be fixed by project-chip/certification-tool-backend#16
Closed

Update TestSelection to use Pydantic #64

raju-apple opened this issue Oct 19, 2023 · 2 comments · May be fixed by project-chip/certification-tool-backend#16
Assignees
Labels
Enhancement New feature or request

Comments

@raju-apple
Copy link

raju-apple commented Oct 19, 2023

From chip-certification-tool-backend created by antonio-amjr: CHIP-Specifications/chip-certification-tool-backend#585

Feature description

Update the TestSelection nested dictionary structure we have today to use Pydantic.
That way we may benefit from the advanced features like validations or nested data model.

As an example, we could have:

class SelectedTestCase(BaseModel):
  public_id: str
  iterations: int = 1

class SelectedTestSuite(BaseModel):
  public_id: str
  test_cases: list [SelectedTestCase] = []

class SelectedCollection(BaseModel):
  collection_name: str
  test_suites: list[SelectedTestSuite] = []

class TestSelection(BaseModel):
  collections: list[SelectedCollection] = []

Use Cases

As a nested data model, the data for TestSelection would be something like:

{
    "collections": [
        {
            "name": "Collection Name",
            "test_suites": [
                {
                    "public_id": "Test Suite ID",
                    "test_cases": [
                        {"public_id": "TestCase1", "iterations": 1},
                        {"public_id": "TestCase2", "iterations": 2},
                    ],
                },
            ],
        }
    ]
}

Test Cases

Many already existing unit tests and code logic would have the change to accommodate this new data models.

Additional Information

No response

@raju-apple raju-apple added the Enhancement New feature or request label Oct 19, 2023
@raju-apple
Copy link
Author

This is not done.
This was discussed in the PR above but it was postpone until a proper moment come.
It's interesting to track this also. I'll add to the task list.

For now, I'm reopening it.

@fabiowmm
Copy link
Contributor

Deprioritized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
3 participants