The Wayback Machine - https://web.archive.org/web/20220502203957/https://github.com/go-gitea/gitea/pull/15116
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

Create Proper Migration tests #15116

Merged
merged 8 commits into from Mar 24, 2021
Merged

Create Proper Migration tests #15116

merged 8 commits into from Mar 24, 2021

Conversation

Copy link
Contributor

@zeripath zeripath commented Mar 22, 2021

Unfortunately our testing regime has so far meant that migrations do not
get proper testing.

This PR begins the process of creating migration tests for this.

Signed-off-by: Andrew Thornton [email protected]

@zeripath
Copy link
Author

@zeripath zeripath commented Mar 22, 2021

TODO:

  • wire into makefile
  • wire into .drone.yml

@zeripath zeripath changed the title WIP: Create Proper Migration tests Create Proper Migration tests Mar 22, 2021
@zeripath
Copy link
Author

@zeripath zeripath commented Mar 22, 2021

OK it's wired in..

The structure is a bit of a hack with the current inferior migration tests still being run from integrations/migration-test - these should probably be either moved in to migrations as proper tests or just removed once we have enough tests to be happy that they are no longer needed.

models/migrations/v177_test.go Outdated Show resolved Hide resolved
models/migrations/migrations_test.go Outdated Show resolved Hide resolved
models/migrations/migrations_test.go Show resolved Hide resolved
models/migrations/migrations_test.go Outdated Show resolved Hide resolved
@zeripath
Copy link
Author

@zeripath zeripath commented Mar 22, 2021

Oh that's interesting there's a bug with drop table columns on mssql ...

@6543 6543 added this to the 1.15.0 milestone Mar 23, 2021
6543
6543 approved these changes Mar 23, 2021
zeripath added 3 commits Mar 23, 2021
Unfortunately our testing regime has so far meant that migrations do not
get proper testing.

This PR begins the process of creating migration tests for this.

Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Signed-off-by: Andrew Thornton <[email protected]>
Copy link
Contributor

@kdumontnu kdumontnu left a comment

Thanks for adding these! 💯

Do you think it would be good practice to add a comment block at the top of v176_test.go and v177_test.go to explain at high level what the migrations intend to do? Ex. "create index X", etc.

@zeripath
Copy link
Author

@zeripath zeripath commented Mar 24, 2021

I think such comments would probably be better on the migration functions themselves.

Signed-off-by: Andrew Thornton <[email protected]>
6543
6543 approved these changes Mar 24, 2021
@6543 6543 merged commit 39ef6f8 into go-gitea:master Mar 24, 2021
2 checks passed
@6543 6543 added the changelog label Mar 24, 2021
@zeripath zeripath deleted the migration-tests branch Mar 24, 2021
@go-gitea go-gitea locked and limited conversation to collaborators May 13, 2021
@lafriks lafriks removed the changelog label Jul 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

5 participants