Fix tests and run them on build