Skip to content

Commit 2bba361

Browse files
committed
tests: s/GITEA_UNIT_TESTS_VERBOSE/GITEA_UNIT_TESTS_LOG_SQL/
The GITEA_UNIT_TESTS_VERBOSE variable is an undocumented variable introduced in 2017 (see 1028ef2) whose sole purpose has been to log SQL statements when running unit tests. It is renamed for clarity. The documentation is updated to reflect this change. Signed-off-by: singuliere <[email protected]>
1 parent c99b8ef commit 2bba361

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

docs/content/doc/developers/hacking-on-gitea.en-us.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ There are two types of test run by Gitea: Unit tests and Integration Tests.
277277
### Unit Tests
278278

279279
Unit tests are covered by `*_test.go` in `go test` system.
280-
You can set environment variable `GITEA_UNIT_TESTS_VERBOSE=1` to see detail logs during the test.
280+
You can set the environment variable `GITEA_UNIT_TESTS_LOG_SQL=1` to display all SQL statements when running the tests in verbose mode (i.e. when `GOTESTFLAGS=-v` is set).
281281

282282
```bash
283283
TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests

models/unittest/testdb.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414

1515
"code.gitea.io/gitea/models/db"
1616
"code.gitea.io/gitea/modules/base"
17+
"code.gitea.io/gitea/modules/log"
1718
"code.gitea.io/gitea/modules/setting"
1819
"code.gitea.io/gitea/modules/storage"
1920
"code.gitea.io/gitea/modules/util"
@@ -152,7 +153,7 @@ func CreateTestEngine(opts FixturesOptions) error {
152153
if err = db.SyncAllTables(); err != nil {
153154
return err
154155
}
155-
switch os.Getenv("GITEA_UNIT_TESTS_VERBOSE") {
156+
switch os.Getenv("GITEA_UNIT_TESTS_LOG_SQL") {
156157
case "true", "1":
157158
x.ShowSQL(true)
158159
}

0 commit comments

Comments
 (0)