Pipeline tests

Adding tests to the pipeline. This pull request is to merge this test work into the pipeline.
@myf and @zmyao88 Please review both logic changes as well as tests.