Integration tests for migrations
There currently are very few integration tests for the migrations and they all rely on an external forge (gitea.com, github.com, ...) to run. Which means that modifying the tests requires access to the repository on the remote forge, or a modification of the test to point to an alternative environment that needs to be copied from the original one (or forked).
In order to test the dump-repo and restore-repo implementation for Gitea without relying on gitea.com, an integration test similar to the one implemented for ActivityPub will be used. It should:
- Create a Gitea server and load the fixtures
- Call the Projectbase.Update method to dump the project
- Verify the
.projectbase
repository is populated with the expected content
Test plan
docker run -ti --rm -e GOTESTFLAGS=-v -e GO_PACKAGES=code.gitea.io/gitea/services/projectbase -e GOCACHE=/drone/src/go-build --volume $(pwd):/drone/src --workdir /drone/src --user gitea gitea/test_env:linux-amd64 make 'test#InitProjectBase'
docker run --rm -ti -e GOCACHE=/drone/src/go-build --volume $(pwd):/drone/src --workdir /drone/src --user gitea gitea/test_env:linux-amd64 bash -c 'make integrations.sqlite.test generate-ini-sqlite && GITEA_CONF=integrations/sqlite.ini ./integrations.sqlite.test -test.v -test.run TestProjectBaseUpdate'