-
-
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
remove sqlite tag when integration test with mysql/postgres and recreate database when init integration test #1693
Conversation
…ate database when init integration test
if _, err = db.Exec("CREATE DATABASE testgitea"); err != nil { | ||
log.Fatalf("db.Exec: %v", err) | ||
if rows.Next() { | ||
if _, err = db.Exec("DROP DATABASE testgitea"); err != nil { |
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.
What does this change do?
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.
When run on drone it's no need. But when run make test-mysql
local, it will failed when you run twice because the old data didn't cleanup. This change will drop the old database and load data from *.yml file.
Apart from the comment, LGTM |
make LG-TM work |
Will it continue to work if user has no rights to drop database? |
@lafriks No, but if they don't they probably don't have rights to create databases as well (previous test created the DB...) |
LGTM |
As title. This will spend less time when run
test-mysql
andtest-pgsql
since there is no CGO build.