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

New(robot): Environment variable TEST_PORT for setting test port #28

Merged
merged 1 commit into from
Mar 5, 2024
Merged
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
23 changes: 12 additions & 11 deletions test/robot/MRkeywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ Library ModelRegistry.py

*** Variables ***
${MR_HOST} %{TEST_MR_HOST=localhost}
${MR_PORT} %{TEST_MR_PORT=8080}
${MODE} %{TEST_MODE=REST}

*** Keywords ***
I create a RegisteredModel having
[Arguments] ${name}
IF $MODE == "REST"
${data} Create Dictionary name=${name}
${resp} POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/registered_models json=${data} expected_status=201
${resp} POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/registered_models json=${data} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -27,7 +28,7 @@ I create a RegisteredModel having
I create a RegisteredModel
[Arguments] ${payload}
IF $MODE == "REST"
${resp} POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/registered_models json=&{payload} expected_status=201
${resp} POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/registered_models json=&{payload} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -41,7 +42,7 @@ I create a child ModelVersion having
[Arguments] ${registeredModelID} ${name}
IF $MODE == "REST"
${data}= Create Dictionary name=${name} registeredModelID=${registeredModelID}
${resp}= POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions json=${data} expected_status=201
${resp}= POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions json=${data} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -56,7 +57,7 @@ I create a child ModelVersion
[Arguments] ${registeredModelID} ${payload}
IF $MODE == "REST"
Set To Dictionary ${payload} registeredModelID=${registeredModelID}
${resp}= POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions json=&{payload} expected_status=201
${resp}= POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions json=&{payload} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -71,7 +72,7 @@ I create a child ModelArtifact having
IF $MODE == "REST"
${data}= Create Dictionary uri=${uri} artifactType=model-artifact
Log to console ${data}
${resp}= POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions/${modelversionId}/artifacts json=${data} expected_status=201
${resp}= POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions/${modelversionId}/artifacts json=${data} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -85,7 +86,7 @@ I create a child ModelArtifact having
I create a child ModelArtifact
[Arguments] ${modelversionId} ${payload}
IF $MODE == "REST"
${resp}= POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions/${modelversionId}/artifacts json=&{payload} expected_status=201
${resp}= POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions/${modelversionId}/artifacts json=&{payload} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -98,7 +99,7 @@ I create a child ModelArtifact
I create a child Artifact
[Arguments] ${modelversionId} ${payload}
IF $MODE == "REST"
${resp}= POST url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions/${modelversionId}/artifacts json=&{payload} expected_status=201
${resp}= POST url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions/${modelversionId}/artifacts json=&{payload} expected_status=201
Log to console ${resp.json()}
${result} Set Variable ${resp.json()['id']}
ELSE
Expand All @@ -111,7 +112,7 @@ I create a child Artifact
I get RegisteredModelByID
[Arguments] ${id}
IF $MODE == "REST"
${resp}= GET url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/registered_models/${id} expected_status=200
${resp}= GET url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/registered_models/${id} expected_status=200
${result} Set Variable ${resp.json()}
Log to console ${resp.json()}
ELSE
Expand All @@ -124,7 +125,7 @@ I get RegisteredModelByID
I get ModelVersionByID
[Arguments] ${id}
IF $MODE == "REST"
${resp}= GET url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions/${id} expected_status=200
${resp}= GET url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions/${id} expected_status=200
${result} Set Variable ${resp.json()}
Log to console ${resp.json()}
ELSE
Expand All @@ -137,7 +138,7 @@ I get ModelVersionByID
I get ModelArtifactByID
[Arguments] ${id}
IF $MODE == "REST"
${resp}= GET url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_artifacts/${id} expected_status=200
${resp}= GET url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_artifacts/${id} expected_status=200
${result} Set Variable ${resp.json()}
Log to console ${resp.json()}
ELSE
Expand All @@ -150,7 +151,7 @@ I get ModelArtifactByID
I get ArtifactsByModelVersionID
[Arguments] ${id}
IF $MODE == "REST"
${resp}= GET url=http://${MR_HOST}:8080/api/model_registry/v1alpha2/model_versions/${id}/artifacts expected_status=200
${resp}= GET url=http://${MR_HOST}:${MR_PORT}/api/model_registry/v1alpha2/model_versions/${id}/artifacts expected_status=200
${result} Set Variable ${resp.json()}
Log to console ${resp.json()}
ELSE
Expand Down
Loading