fixing some sql generation bugs
building test execution logic