-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
improve integration test to resue models/fixtures and store git repos with tests #1627
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
improve integration test to resue models/fixtures and store git repos with tests #1627
Conversation
Trusted LGTM I agree that tests should not require internet connection. Different fixture folders are not necessarally bad if you have different data there. Are fixtures of integration tests different from models @ethantkoenig ? |
Also, maybe get rid of the .tar.gz file, and just store it as is like https://github.com/ethantkoenig/gitea-integration ? Could be in another PR to not block this one. |
Following @andreynering proposition of storing file and not .tar.gz we could vendor it to "easely" follow modification to data set. And like you propose doing it in an other PR is good also. |
I haven't check content of gitea-integration.tar.gz but I can trust LGTM. |
I think store as |
LGTM |
@lunny I they were called |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't work, since the fixtures in models/fixtures
don't match the repos in gitea-integration.tar.gz
If we want to reuse fixtures between unit tests and integration tests, we will need to update gitea-integration.tar.gz
accordingly.
@ethantkoenig yes, you are right. I have updated the file |
@andreynering sure, you are right. There is no |
@lunny We're still missing repositories for every repo other than Is there a reason we need to use the same fixtures for unit tests and integration tests? |
@ethantkoenig use the same fixtures will let us test the data entirely. Two fixtures are always confusing me which one I'm testing. The missing repository could be added in other future PRs. Currently It's enough. |
Could those git repositories be created at runtime rather than being included in the source ? |
@strk, I store it in a |
It would be better to have fixture data in a other repo maybe but this good enough to start using integration test. |
@sapk That was the solution I had in mind with https://github.com/ethantkoenig/gitea-integration. I had hoped/planned to eventually transfer ownership of that repo to @go-gitea |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a huge fan of having inconsistencies between fixtures and repositories, but I'll approve to help move things along.
I'd really prefer if we generated repositories based on the repos. But that might not be doable? |
@ethantkoenig I would like keep the testdata here for version control. Put it a seperate repo seems not necessary. I will merge this at first. Please feel free to discuss here. |
@bkcsoft Do you mean generate repository according the fixtures records? |
@lunny yes. Basically read the fixtures into arrays and create repos out of that |
I'm thinking generate the visit URL according fixtures repos so that we can test all the routes. |
I'm not sure how generating repositories from fixtures would work. It seems that there is a lot of state stored in repositories (mostly commit history) that can't be inferred from fixtures. For example, for each merged entry in the |
Since there are two fixtures, I will remove the fixtures in the integration.tar.gz and only keep git repos in the .tar.gz. Also I keep the
.tar.gz
with the tests and not download from network so that we can keep the meta data with the tests synchronism.