factor out integration test running code