Skip to content

Commit 62980cc

Browse files
Wallis YanJacksonTian
authored andcommitted
基于appveyor构建Windows CI (aliyun#174)
* add .appveyor.yml; add script test_all.py
1 parent e99fab8 commit 62980cc

File tree

7 files changed

+59
-3
lines changed

7 files changed

+59
-3
lines changed

.appveyor.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
version: '1.0.{build}'
2+
3+
environment:
4+
matrix:
5+
- PYTHON: "C:\\Python27"
6+
- PYTHON: "C:\\Python34"
7+
- PYTHON: "C:\\Python35"
8+
- PYTHON: "C:\\Python36"
9+
- PYTHON: "C:\\Python37"
10+
- PYTHON: "C:\\Python27-x64"
11+
- PYTHON: "C:\\Python34-x64"
12+
DISTUTILS_USE_SDK: "1"
13+
- PYTHON: "C:\\Python35-x64"
14+
- PYTHON: "C:\\Python36-x64"
15+
- PYTHON: "C:\\Python37-x64"
16+
17+
skip_commits:
18+
files:
19+
- "*.yml"
20+
- "*.rst"
21+
- "LICENSE"
22+
23+
install:
24+
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
25+
- "%PYTHON%\\python.exe -m pip install unittest2"
26+
- "%PYTHON%\\python.exe -m pip install coverage"
27+
- "%PYTHON%\\python.exe -m pip install pycodestyle"
28+
- "%PYTHON%\\python.exe -m pip install mock"
29+
- "%PYTHON%\\python.exe -m pip install jmespath"
30+
- "%PYTHON%\\python.exe -m pip install pytest==3.2.5"
31+
32+
build: off
33+
34+
test_script:
35+
- "coverage run --branch -m pytest aliyun-python-sdk-core/tests/"
36+
- "%PYTHON%\\python.exe test_all.py"
37+

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Alibaba Cloud Python Software Development Kit
22

33
[![Build Status](https://travis-ci.org/aliyun/aliyun-openapi-python-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-openapi-python-sdk)
4+
[![Appveyor CI Build Status](https://ci.appveyor.com/api/projects/status/qf5svj7bfu4dvhp9?svg=true)](https://ci.appveyor.com/project/wallisyan/aliyun-openapi-python-sdk-qp6kf)
45
[![codecov](https://codecov.io/gh/aliyun/aliyun-openapi-python-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/aliyun/aliyun-openapi-python-sdk)
56

67
[中文文档](./README_zh.md)

README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# 阿里云开发者 Python 工具套件
22

33
[![Build Status](https://travis-ci.org/aliyun/aliyun-openapi-python-sdk.svg?branch=master)](https://travis-ci.org/aliyun/aliyun-openapi-python-sdk)
4+
[![Appveyor CI Build Status](https://ci.appveyor.com/api/projects/status/qf5svj7bfu4dvhp9?svg=true)](https://ci.appveyor.com/project/wallisyan/aliyun-openapi-python-sdk-qp6kf)
45
[![codecov](https://codecov.io/gh/aliyun/aliyun-openapi-python-sdk/branch/master/graph/badge.svg)](https://codecov.io/gh/aliyun/aliyun-openapi-python-sdk)
56

67
欢迎使用阿里云开发者工具套件(SDK)。阿里云 Python SDK 让您不用复杂编程即可访问云服务器、云监控等多个阿里云服务。这里向您介绍如何获取阿里云 Python SDK 并开始调用。

python-sdk-functional-test/bugs_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import datetime
33
import json
44
import sys
5-
from tests import unittest
65
import uuid
76

87
from aliyunsdkcore.acs_exception.exceptions import ServerException

python-sdk-functional-test/credentials_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# encoding:utf-8
22
import json
33
import os
4-
from tests import unittest
54

65
from aliyunsdkcore.acs_exception.exceptions import ClientException
76
from aliyunsdkcore.acs_exception.exceptions import ServerException

python-sdk-functional-test/error_handle_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ def test_server_timeout(self):
3535
except ClientException as e:
3636
self.assertEqual("SDK.HttpError", e.error_code)
3737
head_message, attributes = self._parse_complex_error_message(e.get_error_msg())
38-
self.assertEqual("timed out", head_message)
3938
self.assertEqual("ecs-cn-hangzhou.aliyuncs.com", attributes.get("Endpoint"))
4039
self.assertEqual("Ecs", attributes.get("Product"))
4140
self.assertTrue("SdkCoreVersion" in attributes)

test_all.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import os
2+
from subprocess import check_call
3+
4+
cur_path = os.path.abspath('.')
5+
path_list = []
6+
for ret in os.walk(cur_path):
7+
root_path = ret[0]
8+
root_path_list = root_path.split('\\')
9+
if root_path_list[-1].startswith('aliyun-python-sdk'):
10+
path_list.append(root_path)
11+
12+
os.environ.__setitem__('PYTHONPATH', ';'.join(path_list))
13+
14+
try:
15+
check_call(
16+
"coverage run --branch -m pytest python-sdk-functional-test/", shell=True)
17+
18+
except Exception as e:
19+
raise
20+

0 commit comments

Comments
 (0)