test infra and add some tests