Skip to content

Commit 4e0bdd6

Browse files
authored
Merge pull request #92 from devsapp/add-e2e-test
feat: add e2e model tests and refactor model deployment logic
2 parents 3f67d4c + 6eb24b6 commit 4e0bdd6

File tree

15 files changed

+434
-395
lines changed

15 files changed

+434
-395
lines changed

__tests__/e2e/ci-mac-linux.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,15 @@ else
2626
echo "skip test trigger"
2727
fi
2828

29+
30+
echo "test model download"
31+
cd model
32+
pip install -r requirements.txt
33+
export fc_component_function_name=model-$(uname)-$(uname -m)-$RANDSTR
34+
python deploy_and_test_model.py --model-id iic/cv_LightweightEdge_ocr-recognitoin-general_damo --region cn-shanghai --auto-cleanup
35+
python deploy_and_test_model.py --model-id Qwen/Qwen2.5-0.5B-Instruct --region cn-shanghai --auto-cleanup
36+
cd ..
37+
2938
echo "test go runtime"
3039
cd go
3140
export fc_component_function_name=go1-$(uname)-$(uname -m)-$RANDSTR

__tests__/e2e/local/layer/python/code/index.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from flask import Flask
66
import pycurl
77

8+
89
def handler(event, context):
910
logger = logging.getLogger()
1011
logger.info(event)

__tests__/e2e/local/nas/code/index.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
import logging
44
import os
55

6+
67
def handler(event, context):
7-
filename = '/mnt/auto/test.txt'
8-
if os.path.exists(filename):
9-
with open(filename, 'r') as file:
10-
content = file.read()
8+
filename = "/mnt/auto/test.txt"
9+
if os.path.exists(filename):
10+
with open(filename, "r") as file:
11+
content = file.read()
1112
return "read:{}".format(content)
12-
else:
13-
with open(filename, 'w') as file:
14-
file.write("hello world")
15-
with open(filename, 'r') as file:
16-
content = file.read()
13+
else:
14+
with open(filename, "w") as file:
15+
file.write("hello world")
16+
with open(filename, "r") as file:
17+
content = file.read()
1718
return "write:{}".format(content)

0 commit comments

Comments
 (0)