]> source.dussan.org Git - gitea.git/commitdiff
tests: s/GITEA_UNIT_TESTS_VERBOSE/GITEA_UNIT_TESTS_LOG_SQL/ (#18142)
authorsinguliere <35190819+singuliere@users.noreply.github.com>
Sat, 1 Jan 2022 03:31:24 +0000 (04:31 +0100)
committerGitHub <noreply@github.com>
Sat, 1 Jan 2022 03:31:24 +0000 (04:31 +0100)
The GITEA_UNIT_TESTS_VERBOSE variable is an undocumented variable
introduced in 2017 (see 1028ef2defd94a64f2433b07fe5d93681864cebb)
whose sole purpose has been to log SQL statements when running unit
tests.

It is renamed for clarity and a warning is displayed for backward
compatibility for people and scripts that know about it.

The documentation is updated to reflect this change.

docs/content/doc/developers/hacking-on-gitea.en-us.md
models/unittest/testdb.go

index a0a3725955e1e7aa97b1fdf087571bd93daae080..5f52856d1d2b958cc5bb5102bf6f84dfed21e11b 100644 (file)
@@ -277,7 +277,7 @@ There are two types of test run by Gitea: Unit tests and Integration Tests.
 ### Unit Tests
 
 Unit tests are covered by `*_test.go` in `go test` system.
-You can set environment variable `GITEA_UNIT_TESTS_VERBOSE=1` to see detail logs during the test.
+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).
 
 ```bash
 TAGS="bindata sqlite sqlite_unlock_notify" make test # Runs the unit tests
index c798dbefb1042d30f2173fe2e6707cd07c77efa7..6f3a36ed216f6d2b70295bd4af5dc3cbb82503d8 100644 (file)
@@ -152,7 +152,7 @@ func CreateTestEngine(opts FixturesOptions) error {
        if err = db.SyncAllTables(); err != nil {
                return err
        }
-       switch os.Getenv("GITEA_UNIT_TESTS_VERBOSE") {
+       switch os.Getenv("GITEA_UNIT_TESTS_LOG_SQL") {
        case "true", "1":
                x.ShowSQL(true)
        }