Skip to content

Commit 2de7857

Browse files
authored
[CI] update pytest config (#2620)
1 parent b6709e4 commit 2de7857

File tree

6 files changed

+7
-9
lines changed

6 files changed

+7
-9
lines changed

.github/workflows/ce-unittest-gpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ jobs:
102102
pip config set global.cache-dir "/home/.cache/pip"
103103
set -e
104104
cd /workspace/PaddleFormers && git config --global --add safe.directory $PWD
105-
timeout 2h bash scripts/unit_test/ci_unit.sh ${paddle_whl} true
105+
timeout 40m bash scripts/unit_test/ci_unit.sh ${paddle_whl} true
106106
'
107107
108108
- name: Upload Allure-reports & Logs

.github/workflows/unittest-gpu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
cd /workspace/PaddleFormers && git config --global --add safe.directory $PWD
113113
source $work_dir/../../../proxy
114114
source $work_dir/../../../AISTUDIO_ACCESS_TOKEN
115-
timeout 100m bash scripts/unit_test/ci_unit.sh ${paddle_whl}
115+
timeout 30m bash scripts/unit_test/ci_unit.sh ${paddle_whl}
116116
'
117117
118118
- name: Upload Products

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ addopts = "-ra -q "
1414
pythonpath = ["."]
1515
testpaths = [
1616
"tests/data",
17-
"tests/datasets",
17+
"tests/dataset",
1818
"tests/generation",
1919
"tests/mergekit",
20+
"tests/nn",
2021
"tests/peft",
2122
"tests/trainer",
2223
"tests/transformers",

scripts/unit_test/ci_unit.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,12 @@ set_env() {
4747
export FLAGS_cudnn_deterministic=1
4848
export HF_ENDPOINT=https://hf-mirror.com
4949
export FLAGS_use_cuda_managed_memory=true
50-
export running_time=80m
5150

5251
# for CE
5352
if [[ ${FLAGS_enable_CE} == "true" ]];then
5453
export CE_TEST_ENV=1
5554
export RUN_SLOW_TEST=1
5655
export PYTHONPATH=${nlp_dir}:${nlp_dir}/llm:${PYTHONPATH}
57-
export running_time=5h
5856
fi
5957
}
6058

@@ -111,7 +109,6 @@ if [[ ${FLAGS_enable_CI} == "true" ]] || [[ ${FLAGS_enable_CE} == "true" ]];then
111109
DOWNLOAD_SOURCE=aistudio WAIT_UNTIL_DONE=True \
112110
PYTHONPATH=$(pwd) \
113111
COVERAGE_SOURCE=paddleformers \
114-
timeout ${running_time} \
115112
python -m pytest -v -n 8 \
116113
--dist loadgroup \
117114
--retries 3 --retry-delay 1 \

tests/nn/test_attention.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def test_forward_calls_correct_function(self):
219219
self.key,
220220
self.value,
221221
scaling=self.scaling,
222-
attn_mask_start_row_indices=self.startend_row_indices,
222+
attn_mask_startend_row_indices=self.startend_row_indices,
223223
sink=self.sink,
224224
)
225225

@@ -261,7 +261,7 @@ def test_correctness(self):
261261
self.key,
262262
self.value,
263263
scaling=self.scaling,
264-
attn_mask_start_row_indices=self.startend_row_indices,
264+
attn_mask_startend_row_indices=self.startend_row_indices,
265265
sink=self.sink,
266266
is_causal=False,
267267
)

tests/testing_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ def wrapper(*args, **kwargs):
573573
) # proxy_aistudio also suit for modelscope
574574

575575
print(f"set proxy for {download_hub}, proxy path: {proxy_path}")
576-
command = f"source {proxy_path} && env"
576+
command = f". {proxy_path} && env"
577577

578578
proc = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
579579
out, _ = proc.communicate()

0 commit comments

Comments
 (0)