Skip to content

Commit 450efcc

Browse files
authored
enhancement the codetrans e2e test. (#380)
Signed-off-by: zhlsunshine <[email protected]>
1 parent 0345414 commit 450efcc

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CodeTrans/tests/test_gmc_on_gaudi.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function validate_codetrans() {
6969
export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
7070
echo "$CLIENT_POD"
7171
accessUrl=$(kubectl get gmc -n $APP_NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='codetrans')].status.accessUrl}")
72-
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_codetrans.log
72+
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"query":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:"}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_codetrans.log
7373
exit_code=$?
7474
if [ $exit_code -ne 0 ]; then
7575
echo "codetrans failed, please check the logs in ${LOG_PATH}!"
@@ -79,7 +79,7 @@ function validate_codetrans() {
7979
echo "Checking response results, make sure the output is reasonable. "
8080
local status=false
8181
if [[ -f $LOG_PATH/gmc_codetrans.log ]] && \
82-
[[ $(grep -c "import" $LOG_PATH/gmc_codetrans.log) != 0 ]]; then
82+
[[ $(grep -c "[DONE]" $LOG_PATH/gmc_codetrans.log) != 0 ]]; then
8383
status=true
8484
fi
8585
if [ $status == false ]; then

CodeTrans/tests/test_gmc_on_xeon.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function validate_codetrans() {
6969
export CLIENT_POD=$(kubectl get pod -n $APP_NAMESPACE -l app=client-test -o jsonpath={.items..metadata.name})
7070
echo "$CLIENT_POD"
7171
accessUrl=$(kubectl get gmc -n $APP_NAMESPACE -o jsonpath="{.items[?(@.metadata.name=='codetrans')].status.accessUrl}")
72-
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"language_from": "Golang","language_to": "Python","source_code": "package main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n}"}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_codetrans.log
72+
kubectl exec "$CLIENT_POD" -n $APP_NAMESPACE -- curl $accessUrl -X POST -d '{"query":" ### System: Please translate the following Golang codes into Python codes. ### Original codes: '\'''\'''\''Golang \npackage main\n\nimport \"fmt\"\nfunc main() {\n fmt.Println(\"Hello, World!\");\n '\'''\'''\'' ### Translated codes:"}' -H 'Content-Type: application/json' > $LOG_PATH/gmc_codetrans.log
7373
exit_code=$?
7474
if [ $exit_code -ne 0 ]; then
7575
echo "codetrans failed, please check the logs in ${LOG_PATH}!"
@@ -79,7 +79,7 @@ function validate_codetrans() {
7979
echo "Checking response results, make sure the output is reasonable. "
8080
local status=false
8181
if [[ -f $LOG_PATH/gmc_codetrans.log ]] && \
82-
[[ $(grep -c "import" $LOG_PATH/gmc_codetrans.log) != 0 ]]; then
82+
[[ $(grep -c "[DONE]" $LOG_PATH/gmc_codetrans.log) != 0 ]]; then
8383
status=true
8484
fi
8585
if [ $status == false ]; then

0 commit comments

Comments
 (0)