The contents of this page appear in Guidelines for Writing PTL Tests.
Excerpt | |||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PTL test tags let you list or execute a category of similar or related test cases across test suites in test directories. To include a test case in a category, tag it with the “@tags(<tag_name>)” decorator. Tag names are case-insensitive. See the pbs_benchpress page for how you can use tags to select tests. Pre-defined PTL Test Tags
Tagging Test CasesExamples of tagging test cases: All the test cases of pbs_smoketest.py are tagged with “smoke”. >>>>> Multiple tags can be specified, as shown here: Using Tags to List TestsUse the --tags-info option to list the test cases with a specific tag. For example, to find test cases tagged with "smoke": pbs_benchpress --tags-info --tags=smoke Finding Existing TestsTo find a test case of a particular feature: Ex: Find a ASAP reservations test case
ex. pbs_reservations.py ex. pbs_benchpress -t TestFunctional -i
pbs_benchpress -t TestReservations -i –verbose
pbs_benchpress --tags-info--tags=reservations --verbose The same command can be used to list tests inside the directories. Ex: All reservations tests inside performance directory Placing New Tests in Correct LocationTo add a new test case of a particular feature or bug fix: Ex: A test case for a bug fix that updated accounting logs
ex. In Functional test directory any test file / test suites associated with “log”. If present, add test case into that test suite ex. pbs_benchpress -t TestFunctional -i
If the test case seems to belong to any of the features listed in tag list, it can be tagged so. Ex. @tags(‘accounting’) Using Tags to Run Desired TestsUse the --tags option to execute the test cases, including hierarchical tests, tagged with a specific tag. For example, to execute the test cases tagged with "smoke": pbs_benchpress --tags=smoke Ex: All scheduling_policy tests
pbs_benchpress --tags=scheduling_policy
pbs_benchpress -t <suite names> |
...