mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-02 19:58:03 +00:00
Modify testrail to use global variable for TR URL and project ID
This commit is contained in:
@@ -16,6 +16,7 @@ from pprint import pprint
|
|||||||
import os
|
import os
|
||||||
tr_user=os.getenv('TR_USER')
|
tr_user=os.getenv('TR_USER')
|
||||||
tr_pw=os.getenv('TR_PWD')
|
tr_pw=os.getenv('TR_PWD')
|
||||||
|
project = os.getenv('PROJECT_ID')
|
||||||
|
|
||||||
|
|
||||||
class APIClient:
|
class APIClient:
|
||||||
@@ -125,7 +126,7 @@ class APIClient:
|
|||||||
def get_run_id(self, test_run_name):
|
def get_run_id(self, test_run_name):
|
||||||
"Get the run ID using test name and project name"
|
"Get the run ID using test name and project name"
|
||||||
run_id = None
|
run_id = None
|
||||||
project_id = client.get_project_id(project_name=project_id)
|
project_id = client.get_project_id(project_name=project)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
test_runs = client.send_get('get_runs/%s' % (project_id))
|
test_runs = client.send_get('get_runs/%s' % (project_id))
|
||||||
@@ -180,7 +181,7 @@ class APIClient:
|
|||||||
print("result in post", result)
|
print("result in post", result)
|
||||||
|
|
||||||
client: APIClient = APIClient(os.getenv('TESTRAIL_URL'))
|
client: APIClient = APIClient(os.getenv('TESTRAIL_URL'))
|
||||||
project_id = os.getenv('PROJECT_ID')
|
|
||||||
|
|
||||||
class APIError(Exception):
|
class APIError(Exception):
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user