mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 10:12:26 -05:00
[chore] Test fixes (#788)
* use 'test' value for testrig storage backend * update test dependency * add WaitFor func in testrig * use WaitFor function instead of time.Sleep * tidy up tests * make SentMessages a sync.map * go fmt
This commit is contained in:
parent
bee8458a2d
commit
0245c606d7
30 changed files with 501 additions and 222 deletions
|
|
@ -19,9 +19,6 @@
|
|||
package testrig
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/coreos/go-oidc/v3/oidc"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/config"
|
||||
)
|
||||
|
|
@ -29,12 +26,11 @@ import (
|
|||
// InitTestConfig initializes viper configuration with test defaults.
|
||||
func InitTestConfig() {
|
||||
config.Config(func(cfg *config.Configuration) {
|
||||
*cfg = TestDefaults
|
||||
*cfg = testDefaults
|
||||
})
|
||||
}
|
||||
|
||||
// TestDefaults returns a Values struct with values set that are suitable for local testing.
|
||||
var TestDefaults = config.Configuration{
|
||||
var testDefaults = config.Configuration{
|
||||
LogLevel: "trace",
|
||||
LogDbQueries: true,
|
||||
ApplicationName: "gotosocial",
|
||||
|
|
@ -69,8 +65,11 @@ var TestDefaults = config.Configuration{
|
|||
MediaDescriptionMaxChars: 500,
|
||||
MediaRemoteCacheDays: 30,
|
||||
|
||||
StorageBackend: "local",
|
||||
StorageLocalBasePath: path.Join(os.TempDir(), "gotosocial"),
|
||||
// the testrig only uses in-memory storage, so we can
|
||||
// safely set this value to 'test' to avoid running storage
|
||||
// migrations, and other silly things like that
|
||||
StorageBackend: "test",
|
||||
StorageLocalBasePath: "",
|
||||
|
||||
StatusesMaxChars: 5000,
|
||||
StatusesCWMaxChars: 100,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue