Overview of Testing Your Code
How do We Test Our Code?
We use PTL to test our code. We write a PTL test to cover each change, or we use an existing PTL test.
What is PTL?
PTL is a set of Python modules which provide an interface to PBS. You can use these modules when you test, benchmark, or write a CLI command for PBS.
You use PTL to run and catalog tests. PTL stands for PBS Test Lab. When necessary, you write new tests (such as for new features) and add them to PTL.
When you clone the pbspro GitHub repo, you get that repo's PTL tests along with PBS code. When your changes are merged, so are your PTL tests.
You run a PTL test via the pbs_benchpress command.
We Test Each Code Change
Exceptions aside, you must write a PTL test for every code change, and submit the test in the same commit as your code change.
- You code up a change, say a bugfix
- You build and test the bugfix on your machine in one of 3 ways:
- You use an existing, relevant PTL test
- You write a new PTL test and add that to your commit along with the code change
- You use manual testing, only when it cannot be automated
Prerequisites for Testing Your Code
- You need to have PBS Pro installed on your system
- You need to have PTL installed and set up on your system
Setting Up PTL
Steps for Testing Your Code
Using Travis for Testing
Improving PTL
You can improve PTL by adding tests and improving the PTL framework.