Skip to content

Commit

Permalink
Fix codeflare sdk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Srihari1192 committed Apr 3, 2024
1 parent 389a773 commit de721a3
Showing 1 changed file with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,78 @@ Resource ../../Resources/RHOSi.resource
*** Variables ***
${CODEFLARE-SDK_DIR} codeflare-sdk
${CODEFLARE-SDK_REPO_URL} %{CODEFLARE-SDK_REPO_URL=https://github.com/project-codeflare/codeflare-sdk.git}
${CODEFLARE-SDK_REPO_BRANCH} %{CODEFLARE-SDK_REPO_BRANCH=main}
${VIRTUAL_ENV_NAME} venv3.9


*** Test Cases ***
Run TestMNISTRayClusterSDK test
[Documentation] Run Go E2E test: TestMNISTRayClusterSDK
[Documentation] Run Python E2E test: TestMNISTRayClusterSDK
... ProductBug: https://issues.redhat.com/browse/RHOAIENG-3981 https://issues.redhat.com/browse/RHOAIENG-4240
[Tags] ODS-2544
... Sanity Tier1
... Tier1
... DistributedWorkloads
... Codeflare-sdk
Run Codeflare-sdk E2E Test TestMNISTRayClusterSDK
... ProductBug

Check warning

Code scanning / Robocop

Each next continuation line should be aligned with the previous one Warning test

Each next continuation line should be aligned with the previous one
Skip "Skipping because of RHOAIENG-3981 and RHOAIENG-4240."
Run Codeflare-sdk E2E Test mnist_raycluster_sdk_test.py

Run TestRayClusterSDKOauth test
[Documentation] Run Python E2E test: TestRayClusterSDKOauth
[Tags]
... Tier1
... DistributedWorkloads
... Codeflare-sdk
Run Codeflare-sdk E2E Test mnist_raycluster_sdk_oauth_test.py

*** Keywords ***
Prepare Codeflare-sdk E2E Test Suite
[Documentation] Prepare codeflare-sdk E2E Test Suite
${result} = Run Process git clone -b ${CODEFLARE-SDK_REPO_BRANCH} ${CODEFLARE-SDK_REPO_URL} ${CODEFLARE-SDK_DIR}
${result} = Run Process git clone ${CODEFLARE-SDK_REPO_URL} ${CODEFLARE-SDK_DIR}
... shell=true stderr=STDOUT
Log To Console ${result.stdout}
IF ${result.rc} != 0
FAIL Unable to clone codeflare-sdk repo ${CODEFLARE-SDK_REPO_URL}:${CODEFLARE-SDK_REPO_BRANCH}:${CODEFLARE-SDK_DIR}
FAIL Unable to clone codeflare-sdk repo ${CODEFLARE-SDK_REPO_URL}
END

${result} = Run Process virtualenv -p python3.9 ${VIRTUAL_ENV_NAME}
... shell=true stderr=STDOUT
Log To Console ${result.stdout}
IF ${result.rc} != 0

Check notice

Code scanning / Robocop

'{{ block_name }}' condition can be simplified Note test

'IF' condition can be simplified
FAIL Unable to setup Python virtual environment
END

Enable Component codeflare
Enable Component ray
Create Directory %{WORKSPACE}/codeflare-sdk-e2e-logs
RHOSi Setup

Teardown Codeflare-sdk E2E Test Suite
[Documentation] Teardown codeflare-sdk E2E Test Suite
${result} = Run Process rm -rf ${VIRTUAL_ENV_NAME}
... shell=true stderr=STDOUT
Log To Console ${result.stdout}
IF ${result.rc} != 0

Check notice

Code scanning / Robocop

'{{ block_name }}' condition can be simplified Note test

'IF' condition can be simplified
FAIL Unable to cleanup Python virtual environment
END

${result} = Run Process poetry env use 3.11
... shell=true stderr=STDOUT
IF ${result.rc} != 0

Check notice

Code scanning / Robocop

IF can be replaced with inline IF Note test

IF can be replaced with inline IF

Check notice

Code scanning / Robocop

'{{ block_name }}' condition can be simplified Note test

'IF' condition can be simplified
FAIL Unable to switch python environment 3.11
END

Disable Component codeflare
Disable Component ray
RHOSi Teardown

Run Codeflare-sdk E2E Test
[Documentation] Run codeflare-sdk E2E Test
[Arguments] ${test_name}
Log To Console Running codeflare-sdk test: ${test_name}
${result} = Run Process go test -timeout 30m -v ./tests/e2e -run ${test_name}
[Arguments] ${TEST_NAME}

Check warning

Code scanning / Robocop

{{ var_or_arg }} '{{ variable_name }}' overwrites reserved variable '{{ reserved_variable }}' Warning test

Argument '${TEST_NAME}' overwrites reserved variable '${TEST_NAME}'
Log To Console "Running codeflare-sdk test: ${TEST_NAME}"
${result} = Run Process source ${VIRTUAL_ENV_NAME}/bin/activate && cd codeflare-sdk && poetry env use 3.9 && poetry install --with test,docs && poetry run pytest -v -s ./tests/e2e/${TEST_NAME} --timeout\=600 && deactivate

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (229/120)
... shell=true
... stderr=STDOUT
... cwd=${CODEFLARE-SDK_DIR}
... env:CODEFLARE_TEST_TIMEOUT_SHORT=5m
... env:CODEFLARE_TEST_TIMEOUT_MEDIUM=10m
... env:CODEFLARE_TEST_TIMEOUT_LONG=20m
... env:CODEFLARE_TEST_OUTPUT_DIR=%{WORKSPACE}/codeflare-sdk-e2e-logs
Log To Console ${result.stdout}
IF ${result.rc} != 0
FAIL ${test_name} failed
FAIL ${TEST_NAME} failed
END

0 comments on commit de721a3

Please sign in to comment.