Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

JavaScript sample testing process automation #9

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

JavaScript sample testing process automation #9

wants to merge 3 commits into from

Conversation

zhangyihui1
Copy link

No description provided.

@zhangyihui1 zhangyihui1 changed the title Merge Add a task to IATF server and run case into one script Combine add a task to IATF server and run case into one script Mar 7, 2019
@yanbin7 yanbin7 changed the title Combine add a task to IATF server and run case into one script JavaScript sample testing process automation Mar 7, 2019
src/start.py Outdated
headers = {
"Content-Type": "application/json"
}
task_id = do_request('https://10.239.44.83:8080/rest/v1/tasks', method="PUT", data=json.dumps(TASK),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this address is hard coded?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

src/start.py Outdated
'--server', help='IATF server address.', required=True)
required_arguments.add_argument('--task', help='Task ID.', default=None)
opts = parser.parse_args()

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary empty line

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@zhangyihui1
Copy link
Author

1: got task id automatically
2: run JavaScript test cases automatically

Copy link
Collaborator

@jianjunz jianjunz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need a start.py to run the entire testing process. User's requirement may vary from one scenario to another. We'd better decouple IATF's component and provide the possibility to satisfy as much requirements as possible.

def do_request(url, method='GET', data=None, headers=None):
response = None
if method == 'GET':
response = requests.get(url, verify=False)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting verify=False here is a vulnerability.



def start(id, server, verify):
cmd = ['python3.7', os.path.abspath(os.path.join(THIS_PATH, 'controller/controller.py')), '--server', server,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run python from a python script doesn't make sense.

@yanbin7
Copy link
Contributor

yanbin7 commented Mar 7, 2019

What we needed is get task id automatically which can be integrated to automation process conveniently. And it isn't make sense to set start.py here

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants