mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
The running of `make test` without any additional options will result in the tampering with of ~/.ssh/authorized_keys. This ensures that the tests use a temporary directory by setting SSH.RootPath consistent with other tests in this codebase. Resolves forgejo/forgejo#10164 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10163 Reviewed-by: Michael Kriese <michael.kriese@gmx.de> Co-authored-by: Kevin Schoon <me@kevinschoon.com> Co-committed-by: Kevin Schoon <me@kevinschoon.com>
33 lines
836 B
Go
33 lines
836 B
Go
// Copyright Earl Warren <contact@earl-warren.org>
|
|
// Copyright Loïc Dachary <loic@dachary.org>
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package driver
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"forgejo.org/models/unittest"
|
|
"forgejo.org/modules/setting"
|
|
"forgejo.org/modules/test"
|
|
driver_options "forgejo.org/services/f3/driver/options"
|
|
|
|
_ "forgejo.org/models"
|
|
_ "forgejo.org/models/actions"
|
|
_ "forgejo.org/models/activities"
|
|
_ "forgejo.org/models/perm/access"
|
|
_ "forgejo.org/services/f3/driver/tests"
|
|
|
|
tests_f3 "code.forgejo.org/f3/gof3/v3/tree/tests/f3"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestF3(t *testing.T) {
|
|
require.NoError(t, unittest.PrepareTestDatabase())
|
|
defer test.MockVariableValue(&setting.SSH.RootPath, t.TempDir())()
|
|
tests_f3.ForgeCompliance(t, driver_options.Name)
|
|
}
|
|
|
|
func TestMain(m *testing.M) {
|
|
unittest.MainTest(m)
|
|
}
|