Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migration test #5773

Merged
merged 8 commits into from
Jan 28, 2019
Merged

Add migration test #5773

merged 8 commits into from
Jan 28, 2019

Conversation

zeripath
Copy link
Contributor

@zeripath zeripath commented Jan 19, 2019

This commit adds a simple migration test to ensure that gitea migrate actually works on sqlite.

It does not test the migrated db actually works with Gitea but at least tests whether the migrate command will not barf.

It would not be hard to wire in the integration tests as a next step on the db. (In fact I have already tested this.)

The command is make test-migration and will test migrations on sqlite from v1.4.3, v1.5.3, v1.6.4 and v1.7.0-rc3 to the current master.

Signed-off-by: Andrew Thornton art27@cantab.net

@zeripath
Copy link
Contributor Author

I have not wired the migration test in to the drone CI but this could also be done.

@bkcsoft bkcsoft added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jan 19, 2019
@codecov-io
Copy link

codecov-io commented Jan 19, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@bc748f2). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #5773   +/-   ##
=========================================
  Coverage          ?   38.01%           
=========================================
  Files             ?      328           
  Lines             ?    48328           
  Branches          ?        0           
=========================================
  Hits              ?    18372           
  Misses            ?    27317           
  Partials          ?     2639

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bc748f2...f34ffc0. Read the comment docs.

@zeripath zeripath added the topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile label Jan 19, 2019
@lafriks
Copy link
Member

lafriks commented Jan 21, 2019

This should be added added as drone step

@zeripath zeripath force-pushed the migration-tests branch 2 times, most recently from 4db3e38 to 0bd51a4 Compare January 26, 2019 10:12
@zeripath
Copy link
Contributor Author

OK I've rewritten this.

There are migration tests for mysql, pgsql and sqlite. If anyone can provide sqls for mssql then those can be added. The default database is the testfixtures.

The migration tests are wired into the drone file and are run just before the integration tests.

@zeripath zeripath force-pushed the migration-tests branch 4 times, most recently from b10f5f4 to 828ae44 Compare January 26, 2019 11:58
This commit adds a simple migration test for v1.5.3, v1.6.4 and v1.7.0-rc3

Signed-off-by: Andrew Thornton <art27@cantab.net>
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jan 27, 2019
@zeripath
Copy link
Contributor Author

zeripath commented Jan 27, 2019

OK I've created a new gitea command: gitea dump-fixtures which will create integrations/migration-test/gitea-vVERSION.DATABASE.sql.gz file

Hmm... that doesn't work... I'll repush once I've got that working.

@zeripath
Copy link
Contributor Author

OK I don't think the dump-fixtures command will work unfortunately. The xorm dump tables command doesn't quite translate the sql properly to make this. Perhaps this could be a different PR.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jan 28, 2019
@techknowlogick techknowlogick merged commit 8917d66 into go-gitea:master Jan 28, 2019
@zeripath zeripath deleted the migration-tests branch January 28, 2019 22:04
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. topic/build PR changes how Gitea is built, i.e. regarding Docker or the Makefile
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants