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

Integration test for migration #18124

Merged
merged 5 commits into from
Jan 4, 2022
Merged

Conversation

realaravinth
Copy link
Contributor

@realaravinth realaravinth commented Dec 29, 2021

integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary loic@dachary.org


This PR is on behalf of Loïc Dachary from the forgefriends project. Please see the GitLab merge request for source.

@realaravinth realaravinth changed the title Integration tests for migration Integration test for migration Dec 29, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 29, 2021

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##             main   #18124   +/-   ##
=======================================
  Coverage        ?   45.66%           
=======================================
  Files           ?      828           
  Lines           ?    91675           
  Branches        ?        0           
=======================================
  Hits            ?    41864           
  Misses          ?    43088           
  Partials        ?     6723           

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 165346c...fedea2b. Read the comment docs.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Dec 29, 2021
integrations/uploader_downloader_test.go Outdated Show resolved Hide resolved
services/migrations/migrate.go Outdated Show resolved Hide resolved
@realaravinth realaravinth marked this pull request as draft December 30, 2021 12:51
@realaravinth realaravinth force-pushed the forgefriends-mr-30 branch 6 times, most recently from 405e426 to 0eb55bd Compare December 31, 2021 08:29
@realaravinth
Copy link
Contributor Author

Apologies for multiple force-pushes, this is my first time relaying contributions. I hope future contributions will not be as messy as then one.

Again, apologies and thank you for your patience!

@realaravinth realaravinth marked this pull request as ready for review December 31, 2021 09:08
integrations/dump_restore_test.go Outdated Show resolved Hide resolved
integrations/dump_restore_test.go Outdated Show resolved Hide resolved
@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 1, 2022
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jan 1, 2022

I proposed a PR for the AppVer problem.

If that PR can be accepted, then we can remove the code for setting.AppVer in this PR.

This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

* runs a Gitea server,
* dumps a repo via DumpRepository to the filesystem,
* restores the repo via RestoreRepository from the filesystem,
* dumps the restored repository to the filesystem,
* compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>
@6543
Copy link
Member

6543 commented Jan 2, 2022

I have added https://gitea.com/gitea/go-sdk/pulls/560

will release v0.15.1 sdk after backport of this pull and the version fix ...

@wxiaoguang
Copy link
Contributor

I have added https://gitea.com/gitea/go-sdk/pulls/560

will release v0.15.1 sdk after backport of this pull and the version fix ...

After some discussion, it's preferred to continue to use fake versions during tests.

The comment is updated.

@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 4, 2022
@6543 6543 added this to the 1.16.0 milestone Jan 4, 2022
Copy link
Contributor

@Gusted Gusted left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Little thingy.

integrations/dump_restore_test.go Outdated Show resolved Hide resolved
integrations/dump_restore_test.go Outdated Show resolved Hide resolved
integrations/dump_restore_test.go Outdated Show resolved Hide resolved
Co-authored-by: Gusted <williamzijl7@hotmail.com>
@6543 6543 merged commit 12ad6dd into go-gitea:main Jan 4, 2022
@realaravinth
Copy link
Contributor Author

On behalf of @dachary:

@Gusted thanks for fixing the ioutil vs os comopatibility, good catch too :-)

@6543 & @wxiaoguang I'm impressed by the level of attention you gave to this API version issue, kudos.


source

lunny added a commit that referenced this pull request Jan 5, 2022
* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* fix

* gofumpt

* Integration test for migration (#18124)

integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>

* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* Fix bug

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
zjjhot added a commit to zjjhot/gitea that referenced this pull request Jan 6, 2022
* 'main' of https://github.com/go-gitea/gitea:
  Enable partial clone by default (go-gitea#18195)
  Add option to convert CRLF to LF line endings for sendmail (go-gitea#18075)
  Add replay of webhooks. (go-gitea#18191)
  Load EasyMDE/CodeMirror dynamically, remove RequireEasyMDE (go-gitea#18069)
  refactoring nits (go-gitea#18188)
  slight optimization for default avatar (go-gitea#18187)
  code.gitea.io/sdk/gitea v0.14.0 -> v0.15.1 (go-gitea#18186)
  Team permission allow different unit has different permission (go-gitea#17811)
  Integration test for migration (go-gitea#18124)
  Update `TODOs` badge to reflect new default branch (go-gitea#18182)
  Increase Salt randomness  (go-gitea#18179)
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
…ea#17811)

* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* fix

* gofumpt

* Integration test for migration (go-gitea#18124)

integrations: basic test for Gitea {dump,restore}-repo
This is a first step for integration testing of DumpRepository and
RestoreRepository. It:

runs a Gitea server,
dumps a repo via DumpRepository to the filesystem,
restores the repo via RestoreRepository from the filesystem,
dumps the restored repository to the filesystem,
compares the first and second dump and expects them to be identical

The verification is trivial and the goal is to add more tests for each
topic of the dump.

Signed-off-by: Loïc Dachary <loic@dachary.org>

* Team permission allow different unit has different permission

* Finish the interface and the logic

* Fix lint

* Fix translation

* align center for table cell content

* Fix fixture

* merge

* Fix test

* Add deprecated

* Improve code

* Add tooltip

* Fix swagger

* Fix newline

* Fix tests

* Fix tests

* Fix test

* Fix test

* Max permission of external wiki and issues should be read

* Move team units with limited max level below units table

* Update label and column names

* Some improvements

* Fix lint

* Some improvements

* Fix template variables

* Add permission docs

* improve doc

* Fix fixture

* Fix bug

* Fix some bug

* Fix bug

Co-authored-by: Lauris BH <lauris@nix.lv>
Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Aravinth Manivannan <realaravinth@batsense.net>
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
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. type/testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants