Skip to content

Add an option in run_tests.sh to run tests in the input order and make kvm tests running in input order#2419

Merged
lguohan merged 3 commits intosonic-net:masterfrom
shi-su:test_order
Oct 29, 2020
Merged

Add an option in run_tests.sh to run tests in the input order and make kvm tests running in input order#2419
lguohan merged 3 commits intosonic-net:masterfrom
shi-su:test_order

Conversation

@shi-su
Copy link
Contributor

@shi-su shi-su commented Oct 28, 2020

Description of PR

Summary: Add an option in run_tests.sh to run tests in the input order and make kvm tests running in input order
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

What is the motivation for this PR?

Currently, run_tests.sh sort tests in alphabetical order. Running in the input order may provide more freedom in organizing test cases. Adding running in input order as an option in run_tests.sh.

How did you do it?

Add an option in run_tests.sh to run tests in the input order rather than alphabetical order. And make kvm tests running in input order.

How did you verify/test it?

Verified by running tests locally.

Any platform specific information?

Supported testbed topology if it's a new test case?

Documentation

fi
# Ignore the scripts specified in $SKIP_SCRIPTS
TEST_CASES=$(python -c "print '\n'.join(set('''$all_scripts'''.split()) - set('''$SKIP_SCRIPTS'''.split()))" | sort)
TEST_CASES=$(python -c "print '\n'.join([testcase for testcase in list('''$all_scripts'''.split()) if testcase not in set('''$SKIP_SCRIPTS'''.split())])")
Copy link
Contributor

Choose a reason for hiding this comment

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

there are two mode, group mode and individual mode, I do not know if we need to run alphabetic order for the group mode, and only preserve the order for the individual mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made running in input order as a command-line option.

@bingwang-ms
Copy link
Collaborator

Normally, all test cases should be independent to each other. So running order should make no difference to the result. But there are some cases that may left routes/IP on DUT or change the configuration of DUT, which may fail following cases. In such case, running them in alphabetic order enables us to analyze it more easily. Maybe we could add another command line option to toggle the dafault sort behavior.

@lguohan
Copy link
Contributor

lguohan commented Oct 28, 2020

agree with you that test cases should be independent to each other. but sometimes, we do want to make sure certain test cases can be run first for examle warm reboot so that we can test behavior after the warm reboot. but I think adding a command line option is probably a better design.

@shi-su shi-su changed the title [run_tests.sh] Run tests in the input order Add an option in run_tests.sh to run tests in the input order and make kvm tests running in input order Oct 28, 2020
@shi-su shi-su requested a review from lguohan October 28, 2020 20:37
@lguohan lguohan merged commit afca259 into sonic-net:master Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants