PP-1278: Need a skip decorator in PTL which will skip the test without any condition.

Description:
Currently in PTL we don't have any decorator which will skip the testcase irrespective of any condition. We need such decorator, so that without adding any skip code inside the testcase, we can skip the testcase in any condition just by applying it.


Forum: http://community.pbspro.org/t/pp-1278-need-a-skip-decorator-in-ptl-which-will-skip-the-test-without-any-condition/1000


Interface: @skip(reason=<reason_for_skip>)
Visibility: Public
Change Control: Stable
Synopsis: New interface to skip the testcase without any skip condition.
Details: This interface will provide user a way to skip a particular testcase with the reason and irrespective of any skip condition.

  • This interface takes one parameter called 'reason'.
  • If '@skip' is applied over a testcase then:
    • Call 'skip()' function defined inside 'utils/pbs_testsuite.py'.
    • Define a wrapper inside 'skip()' which will set unittest skip flag(__unittest_skip__)  and skip reason (__unittest_skip_why__) .
    • Return the wrapper function.
    • Unittest run method will skip the testcase setUp() and execution with the reason passed.
  • Example:

Skip test test_t1:

@skip(reason="Skipping this test due to <issue_id>")
def test_t1:

.

.

Skip the complete testsuite:

@skip(reason="Skipping this testsuite due to <issue_id>")

class SmokeTest():

.

.