-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Sqlite supports memory database for test purpose #32610
Conversation
Pull request was converted to draft
It is not right to use |
ref from https://github.com/mattn/go-sqlite3?tab=readme-ov-file#faq |
I do not see real benefits to play with them. |
I think this is the only method to use memory because memory cannot be used with WAL. https://sqlite.org/forum/info/a44bddd65750d084 |
But the sqlite tests are fast enough, I do not think these tricks would save more minutes. The slowest test is still mysql |
And I think we already used gitea/models/unittest/testdb.go Line 206 in 5d57c28
But I think you are right. SQLite test is not the bottleneck of tests. So I will close this pull request. |
That's different. Other test uses the same connection pool. But migration tests create 2 isolated connection pools, that's why it's difficult to play tricks with it. |
To make tests run faster, allow sqlite's PATH as a
:memory:
which means run sqlite memory-only. The data will disappear when Gitea or Gitea test exit.