govanityurls icon indicating copy to clipboard operation
govanityurls copied to clipboard

add integration tests

Open zombiezen opened this issue 7 years ago • 3 comments

This test verifies that the output from this system is usable by the go get tool. It operates by proxying go get HTTP requests to a locally running proxy, then checking the URL the VCS cloned from.

This isn't a hermetic test: it requires internet access to github.com and bitbucket.org, which I'm not sure how to reasonably fake and provide the same level of confidence. It checks PATH for locally installed copies of go, git, and hg, but those could be bundled in a test environment.

I bumped up the version of Go required/tested against to Go 1.8 in order to use subtests. Go 1.8 is now GA on App Engine, so this should not be a problem.

zombiezen avatar Jan 29 '18 18:01 zombiezen

@rakyll ping

zombiezen avatar Feb 01 '18 17:02 zombiezen

I didn't truly understand why we need to verify go get requests. Don't we instead need to test manually cloning and go get'in from the vanity URL and assert whether the downloaded repo is the same?

rakyll avatar Mar 02 '18 22:03 rakyll

The reason I'm not checking the contents of the checkout right now is because the repository could change while the test is running, since the test is not hermetic. I agree that it would be good to check the commit, especially since I'm building toward the feature I described in #17 and want to build confidence that it works. Perhaps I should bite the bullet and have the test spin up a local Git HTTP server?

zombiezen avatar Mar 07 '18 16:03 zombiezen