Skip to content

Commit 154fac8

Browse files
JacksonTianyndu13
authored andcommitted
fix: refine the functional test
1 parent 58d5f3c commit 154fac8

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2-
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
41
name: Python test
52

63
on:
@@ -20,6 +17,10 @@ jobs:
2017
env:
2118
ACCESS_KEY_ID: ${{ secrets.ACCESS_KEY_ID }}
2219
ACCESS_KEY_SECRET: ${{ secrets.ACCESS_KEY_SECRET }}
20+
REGION_ID: ${{ vars.REGION_ID }}
21+
USER_ID: ${{ secrets.USER_ID }}
22+
ROOT_UID: ${{ secrets.ROOT_UID }}
23+
CONCURRENT_ID: ${{ strategy.job-index }}
2324

2425
steps:
2526
- uses: actions/checkout@v3

python-sdk-functional-test/base.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,13 @@ def _init_env(self):
100100
self.region_id = self._read_key_from_env_or_config("REGION_ID")
101101
self.user_id = self._read_key_from_env_or_config("USER_ID")
102102
self.root_user_id = self._read_key_from_env_or_config("ROOT_UID")
103-
if 'TRAVIS_JOB_NUMBER' in os.environ:
104-
self.travis_concurrent = os.environ.get('TRAVIS_JOB_NUMBER').split(".")[-1]
103+
if 'CONCURRENT_ID' in os.environ:
104+
self.concurrent_id = os.environ.get('CONCURRENT_ID')
105105
else:
106-
self.travis_concurrent = "0"
107-
self.default_ram_user_name = "RamUserForSDKCredentialsTest" + self.travis_concurrent
108-
self.default_ram_role_name = "RamROleForSDKTest" + self.travis_concurrent
109-
self.default_role_session_name = "RoleSession" + self.travis_concurrent
106+
self.concurrent_id = "0"
107+
self.default_ram_user_name = "RamUserForSDKCredentialsTest" + self.concurrent_id
108+
self.default_ram_role_name = "RamRoleForSDKTest" + self.concurrent_id
109+
self.default_role_session_name = "RoleSession" + self.concurrent_id
110110
self.ram_user_id = None
111111
self.ram_policy_attched = False
112112
self.ram_user_access_key_id = None
@@ -143,7 +143,7 @@ def init_client(self, region_id=None):
143143

144144
@staticmethod
145145
def get_dict_response(string):
146-
return json.loads(string.decode('utf-8'), encoding="utf-8")
146+
return json.loads(string.decode('utf-8'))
147147

148148
def _create_default_ram_user(self):
149149
if self.ram_user_id:

0 commit comments

Comments
 (0)