forked from red-hat-data-services/ods-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RHODS-12410 - Robot framework test for DW (red-hat-data-services#980)
- Loading branch information
1 parent
f266f03
commit c9d0eec
Showing
3 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
2 changes: 2 additions & 0 deletions
2
ods_ci/tasks/Resources/RHODS_OLM/install/codeflare_install.resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
ods_ci/tests/Resources/Page/DistributedWorkloads/DistributedWorkloads.resource
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
*** Settings *** | ||
Documentation This is a resource file for Distributed Workloads. | ||
Library OperatingSystem | ||
Library Process | ||
|
||
|
||
*** Variables *** | ||
${CODEFLARE_TEST_TIMEOUT_LONG} 20m | ||
${GO_TEST_TIMEOUT} 1h | ||
${JOB_GO_BIN} %{WORKSPACE=.}/go-bin | ||
${GO_JUNIT_REPORT_TOOL} github.com/jstemmer/go-junit-report/v2@latest | ||
|
||
|
||
*** Keywords *** | ||
Clone Git Repository | ||
[Documentation] Clone Git repository | ||
[Arguments] ${DW_REPO_URL} ${DW_REPO_BRANCH} ${DW_DIR} | ||
${result} = Run Process git clone -b ${DW_REPO_BRANCH} ${DW_REPO_URL} ${DW_DIR} | ||
... shell=true stderr=STDOUT | ||
Log To Console ${result.stdout} | ||
IF ${result.rc} != 0 | ||
FAIL Unable to clone DW repo ${DW_REPO_URL}:${DW_REPO_BRANCH}:${DW_DIR} | ||
END | ||
|
||
Run Distributed Workloads Tests | ||
[Documentation] Run distributed workloads E2E tests from integration directory | ||
[Arguments] ${DW_DIR} ${DW_TEST_RESULT_FILE} ${TEST_PARAMETERS} | ||
${result} = Run Process | ||
... go test -v -timeout ${GO_TEST_TIMEOUT} ./integration ${TEST_PARAMETERS} 2>&1 > ${DW_TEST_RESULT_FILE} | ||
... shell=true cwd=${DW_DIR}/tests env:ODH_NAMESPACE=redhat-ods-applications | ||
... env:CODEFLARE_TEST_TIMEOUT_LONG=${CODEFLARE_TEST_TIMEOUT_LONG} | ||
Log To Console ${result.stdout} | ||
${test_output}= Get File ${DW_TEST_RESULT_FILE} | ||
Log To Console ${test_output} | ||
RETURN ${result.rc} | ||
|
||
Install Go Junit Report Tool | ||
[Documentation] Use Go install command to install Go Junit report tool | ||
${result} = Run Process go install ${GO_JUNIT_REPORT_TOOL} | ||
... shell=true env:GOBIN=${JOB_GO_BIN} stderr=STDOUT | ||
Log To Console ${result.stdout} | ||
IF ${result.rc} != 0 | ||
FAIL Failed to install Go junit report tool | ||
END | ||
|
||
Convert Go Test Results To Junit | ||
[Documentation] Use Go Junit report tool to convert Go test results to Junit | ||
[Arguments] ${DW_TEST_RESULT_FILE} ${DW_JUNIT_FILE} | ||
${result} = Run Process ${JOB_GO_BIN}/go-junit-report -in ${DW_TEST_RESULT_FILE} -iocopy -out ${DW_JUNIT_FILE} | ||
... shell=true stderr=STDOUT | ||
Log To Console ${result.stdout} | ||
IF ${result.rc} != 0 | ||
FAIL Failed to convert Go test results to Junit | ||
END |
26 changes: 26 additions & 0 deletions
26
ods_ci/tests/Tests/650__distributed_workloads/test-run-dw-tests.robot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
*** Settings *** | ||
Documentation Distributed workloads tests | ||
Resource ../../../tasks/Resources/RHODS_OLM/install/codeflare_install.resource | ||
Resource ../../Resources/Page/DistributedWorkloads/DistributedWorkloads.resource | ||
|
||
|
||
*** Variables *** | ||
${DW_DIR} distributed-workloads | ||
${DW_TEST_RESULT_FILE} %{WORKSPACE=.}/dw-test-results.txt | ||
${DW_JUNIT_FILE} %{WORKSPACE=.}/junit.xml | ||
|
||
|
||
*** Test Cases *** | ||
Run distributed workloads sanity tests | ||
[Documentation] Run tests located in Distributed Workloads repo downstream | ||
[Tags] Sanity | ||
Skip If "%{OPERATOR_TYPE}" != "RHODS Operator V2" | ||
DistributedWorkloads.Clone Git Repository %{DW_GIT_REPO} %{DW_GIT_REPO_BRANCH} ${DW_DIR} | ||
${test_result}= Run Distributed Workloads Tests ${DW_DIR} ${DW_TEST_RESULT_FILE} -run '.*Test[RK].*[^r]$' -parallel 1 %{DW_GO_TESTS_PARAMS} | ||
Install Go Junit Report Tool | ||
Convert Go Test Results To Junit ${DW_TEST_RESULT_FILE} ${DW_JUNIT_FILE} | ||
IF ${test_result} != 0 | ||
FAIL There were test failures in the Distributed Workloads tests. | ||
END |