Skip to content

Commit

Permalink
[Test] Correctly delete workspaces in performance tests (#22178)
Browse files Browse the repository at this point in the history
* delete dwt object in API tests
  • Loading branch information
SkorikSergey committed Apr 26, 2023
1 parent 7156932 commit 34b9a8b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/performance/api-tests/api-test-cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testProjectImported ${WORKSPACE_NAME} ${containerName} ${projectName}

testCommand ${WORKSPACE_NAME} ${containerName} "${commandToTest}" "${expectedCommandOutput}"

oc delete dw $WORKSPACE_NAME || true
deleteWorkspace ${WORKSPACE_NAME}
2 changes: 1 addition & 1 deletion tests/performance/api-tests/api-test-lombok.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testProjectImported ${WORKSPACE_NAME} ${containerName} ${projectName}

testCommand ${WORKSPACE_NAME} ${containerName} "${commandToTest}" "${expectedCommandOutput}"

oc delete dw $WORKSPACE_NAME || true
deleteWorkspace ${WORKSPACE_NAME}
2 changes: 1 addition & 1 deletion tests/performance/api-tests/api-test-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testProjectImported ${WORKSPACE_NAME} ${containerName} ${projectName}

testCommand ${WORKSPACE_NAME} ${containerName} "${commandToTest}" "${expectedCommandOutput}"

oc delete dw $WORKSPACE_NAME || true
deleteWorkspace ${WORKSPACE_NAME}
2 changes: 1 addition & 1 deletion tests/performance/api-tests/api-test-python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testProjectImported ${WORKSPACE_NAME} ${containerName} ${projectName}

testCommand ${WORKSPACE_NAME} ${containerName} "${commandToTest}" "${expectedCommandOutput}"

oc delete dw $WORKSPACE_NAME || true
deleteWorkspace ${WORKSPACE_NAME}
2 changes: 1 addition & 1 deletion tests/performance/api-tests/api-test-quarkus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ testProjectImported ${WORKSPACE_NAME} ${containerName} ${projectName}

testCommand ${WORKSPACE_NAME} ${containerName} "${commandToTest}" "${expectedCommandOutput}"

oc delete dw $WORKSPACE_NAME || true
deleteWorkspace ${WORKSPACE_NAME}
9 changes: 9 additions & 0 deletions tests/performance/api-tests/api-utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,12 @@ function testCommand() {
exit 1
fi
}

# This function deletes created workspace(dw and dwt objects).
#
# Arguments:
# $1: workspace name
function deleteWorkspace() {
oc delete dw $1 || true
oc delete dwt che-code-$1 || true
}

0 comments on commit 34b9a8b

Please sign in to comment.