Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions package/docs/apis/tags/CoreApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ with gentrace.ApiClient(configuration) as api_client:
# example passing only required values which don't have defaults set
body = RunRequest(
id="id_example",
collection_method="manual",
slug="slug_example",
name="name_example",
step_runs=[
Expand Down Expand Up @@ -668,6 +669,7 @@ with gentrace.ApiClient(configuration) as api_client:
body = dict(
pipeline_slug="pipeline_slug_example",
pipeline_id="pipeline_id_example",
collection_method="manual",
branch="branch_example",
commit="commit_example",
name="name_example",
Expand Down Expand Up @@ -727,6 +729,7 @@ Key | Input Type | Accessed Type | Description | Notes
**[testRuns](#testRuns)** | list, tuple, | tuple, | |
**pipelineSlug** | str, | str, | The pipeline slug to create the test result for. Only one of pipelineSlug or pipelineId is required. | [optional]
**pipelineId** | str, | str, | The pipeline ID to create the test result for. Only one of pipelineSlug or pipelineId is required. | [optional]
**collectionMethod** | str, | str, | The method used to collect the test runs | [optional] must be one of ["manual", "runner", ]
**branch** | None, str, | NoneClass, str, | The branch that the test result was created from | [optional]
**commit** | None, str, | NoneClass, str, | The commit that the test result was created from | [optional]
**name** | None, str, | NoneClass, str, | The name of the test result | [optional]
Expand Down
1 change: 1 addition & 0 deletions package/docs/models/RunRequest.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**[stepRuns](#stepRuns)** | list, tuple, | tuple, | |
**id** | str, uuid.UUID, | str, | | value must be a uuid
**collectionMethod** | str, | str, | The method used to collect the run | [optional] must be one of ["manual", "runner", ]
**slug** | str, | str, | | [optional]
**name** | str, | str, | | [optional]
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional]
Expand Down
34 changes: 32 additions & 2 deletions package/gentrace/model/run_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,33 @@ def __new__(

def __getitem__(self, i: int) -> 'StepRun':
return super().__getitem__(i)


class collectionMethod(
schemas.EnumBase,
schemas.StrSchema
):


class MetaOapg:
enum_value_to_name = {
"manual": "MANUAL",
"runner": "RUNNER",
}

@schemas.classproperty
def MANUAL(cls):
return cls("manual")

@schemas.classproperty
def RUNNER(cls):
return cls("runner")
slug = schemas.StrSchema
name = schemas.StrSchema
__annotations__ = {
"id": id,
"stepRuns": stepRuns,
"collectionMethod": collectionMethod,
"slug": slug,
"name": name,
}
Expand All @@ -85,6 +107,9 @@ def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.propert
@typing.overload
def __getitem__(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["slug"]) -> MetaOapg.properties.slug: ...

Expand All @@ -94,7 +119,7 @@ def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.prope
@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)

Expand All @@ -105,6 +130,9 @@ def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.prope
@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["slug"]) -> typing.Union[MetaOapg.properties.slug, schemas.Unset]: ...

Expand All @@ -114,7 +142,7 @@ def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union
@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]):
return super().get_item_oapg(name)


Expand All @@ -123,6 +151,7 @@ def __new__(
*_args: typing.Union[dict, frozendict.frozendict, ],
stepRuns: typing.Union[MetaOapg.properties.stepRuns, list, tuple, ],
id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ],
collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset,
slug: typing.Union[MetaOapg.properties.slug, str, schemas.Unset] = schemas.unset,
name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset,
_configuration: typing.Optional[schemas.Configuration] = None,
Expand All @@ -133,6 +162,7 @@ def __new__(
*_args,
stepRuns=stepRuns,
id=id,
collectionMethod=collectionMethod,
slug=slug,
name=name,
_configuration=_configuration,
Expand Down
27 changes: 25 additions & 2 deletions package/gentrace/model/run_request.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,26 @@ class RunRequest(

def __getitem__(self, i: int) -> 'StepRun':
return super().__getitem__(i)


class collectionMethod(
schemas.EnumBase,
schemas.StrSchema
):

@schemas.classproperty
def MANUAL(cls):
return cls("manual")

@schemas.classproperty
def RUNNER(cls):
return cls("runner")
slug = schemas.StrSchema
name = schemas.StrSchema
__annotations__ = {
"id": id,
"stepRuns": stepRuns,
"collectionMethod": collectionMethod,
"slug": slug,
"name": name,
}
Expand All @@ -84,6 +99,9 @@ class RunRequest(
@typing.overload
def __getitem__(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["slug"]) -> MetaOapg.properties.slug: ...

Expand All @@ -93,7 +111,7 @@ class RunRequest(
@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)

Expand All @@ -104,6 +122,9 @@ class RunRequest(
@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["slug"]) -> typing.Union[MetaOapg.properties.slug, schemas.Unset]: ...

Expand All @@ -113,7 +134,7 @@ class RunRequest(
@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]):
return super().get_item_oapg(name)


Expand All @@ -122,6 +143,7 @@ class RunRequest(
*_args: typing.Union[dict, frozendict.frozendict, ],
stepRuns: typing.Union[MetaOapg.properties.stepRuns, list, tuple, ],
id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ],
collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset,
slug: typing.Union[MetaOapg.properties.slug, str, schemas.Unset] = schemas.unset,
name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset,
_configuration: typing.Optional[schemas.Configuration] = None,
Expand All @@ -132,6 +154,7 @@ class RunRequest(
*_args,
stepRuns=stepRuns,
id=id,
collectionMethod=collectionMethod,
slug=slug,
name=name,
_configuration=_configuration,
Expand Down
34 changes: 32 additions & 2 deletions package/gentrace/paths/test_result/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,27 @@ class properties:
pipelineId = schemas.StrSchema


class collectionMethod(
schemas.EnumBase,
schemas.StrSchema
):


class MetaOapg:
enum_value_to_name = {
"manual": "MANUAL",
"runner": "RUNNER",
}

@schemas.classproperty
def MANUAL(cls):
return cls("manual")

@schemas.classproperty
def RUNNER(cls):
return cls("runner")


class branch(
schemas.StrBase,
schemas.NoneBase,
Expand Down Expand Up @@ -256,6 +277,7 @@ def __getitem__(self, i: int) -> MetaOapg.items:
__annotations__ = {
"pipelineSlug": pipelineSlug,
"pipelineId": pipelineId,
"collectionMethod": collectionMethod,
"branch": branch,
"commit": commit,
"name": name,
Expand All @@ -270,6 +292,9 @@ def __getitem__(self, name: typing_extensions.Literal["pipelineSlug"]) -> MetaOa
@typing.overload
def __getitem__(self, name: typing_extensions.Literal["pipelineId"]) -> MetaOapg.properties.pipelineId: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ...

Expand All @@ -285,7 +310,7 @@ def __getitem__(self, name: typing_extensions.Literal["testRuns"]) -> MetaOapg.p
@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)

Expand All @@ -296,6 +321,9 @@ def get_item_oapg(self, name: typing_extensions.Literal["pipelineSlug"]) -> typi
@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["pipelineId"]) -> typing.Union[MetaOapg.properties.pipelineId, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ...

Expand All @@ -311,7 +339,7 @@ def get_item_oapg(self, name: typing_extensions.Literal["testRuns"]) -> MetaOapg
@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]):
return super().get_item_oapg(name)


Expand All @@ -321,6 +349,7 @@ def __new__(
testRuns: typing.Union[MetaOapg.properties.testRuns, list, tuple, ],
pipelineSlug: typing.Union[MetaOapg.properties.pipelineSlug, str, schemas.Unset] = schemas.unset,
pipelineId: typing.Union[MetaOapg.properties.pipelineId, str, schemas.Unset] = schemas.unset,
collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset,
branch: typing.Union[MetaOapg.properties.branch, None, str, schemas.Unset] = schemas.unset,
commit: typing.Union[MetaOapg.properties.commit, None, str, schemas.Unset] = schemas.unset,
name: typing.Union[MetaOapg.properties.name, None, str, schemas.Unset] = schemas.unset,
Expand All @@ -333,6 +362,7 @@ def __new__(
testRuns=testRuns,
pipelineSlug=pipelineSlug,
pipelineId=pipelineId,
collectionMethod=collectionMethod,
branch=branch,
commit=commit,
name=name,
Expand Down
27 changes: 25 additions & 2 deletions package/gentrace/paths/test_result/post.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ class SchemaForRequestBodyApplicationJson(
pipelineId = schemas.StrSchema


class collectionMethod(
schemas.EnumBase,
schemas.StrSchema
):

@schemas.classproperty
def MANUAL(cls):
return cls("manual")

@schemas.classproperty
def RUNNER(cls):
return cls("runner")


class branch(
schemas.StrBase,
schemas.NoneBase,
Expand Down Expand Up @@ -254,6 +268,7 @@ class SchemaForRequestBodyApplicationJson(
__annotations__ = {
"pipelineSlug": pipelineSlug,
"pipelineId": pipelineId,
"collectionMethod": collectionMethod,
"branch": branch,
"commit": commit,
"name": name,
Expand All @@ -268,6 +283,9 @@ class SchemaForRequestBodyApplicationJson(
@typing.overload
def __getitem__(self, name: typing_extensions.Literal["pipelineId"]) -> MetaOapg.properties.pipelineId: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ...

@typing.overload
def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ...

Expand All @@ -283,7 +301,7 @@ class SchemaForRequestBodyApplicationJson(
@typing.overload
def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ...

def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]):
def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]):
# dict_instance[name] accessor
return super().__getitem__(name)

Expand All @@ -294,6 +312,9 @@ class SchemaForRequestBodyApplicationJson(
@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["pipelineId"]) -> typing.Union[MetaOapg.properties.pipelineId, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ...

@typing.overload
def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ...

Expand All @@ -309,7 +330,7 @@ class SchemaForRequestBodyApplicationJson(
@typing.overload
def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ...

def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]):
def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]):
return super().get_item_oapg(name)


Expand All @@ -319,6 +340,7 @@ class SchemaForRequestBodyApplicationJson(
testRuns: typing.Union[MetaOapg.properties.testRuns, list, tuple, ],
pipelineSlug: typing.Union[MetaOapg.properties.pipelineSlug, str, schemas.Unset] = schemas.unset,
pipelineId: typing.Union[MetaOapg.properties.pipelineId, str, schemas.Unset] = schemas.unset,
collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset,
branch: typing.Union[MetaOapg.properties.branch, None, str, schemas.Unset] = schemas.unset,
commit: typing.Union[MetaOapg.properties.commit, None, str, schemas.Unset] = schemas.unset,
name: typing.Union[MetaOapg.properties.name, None, str, schemas.Unset] = schemas.unset,
Expand All @@ -331,6 +353,7 @@ class SchemaForRequestBodyApplicationJson(
testRuns=testRuns,
pipelineSlug=pipelineSlug,
pipelineId=pipelineId,
collectionMethod=collectionMethod,
branch=branch,
commit=commit,
name=name,
Expand Down
2 changes: 2 additions & 0 deletions package/gentrace/providers/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,8 @@ def run_test(pipeline_slug: str, handler) -> Result:
params["commit"] = GENTRACE_CONFIG_STATE["GENTRACE_COMMIT"] or os.getenv(
"GENTRACE_COMMIT"
)

params["collectionMethod"] = "runner"

response = api.test_result_post(params)
return response.body
Expand Down