From 31882abf6fb5015c1145690191fb8f0ae9780cbe Mon Sep 17 00:00:00 2001 From: Deluan Date: Tue, 26 Jul 2022 16:47:16 -0400 Subject: [PATCH] Upgrade Ginkgo to V2 --- Makefile | 4 +- core/agents/agents_suite_test.go | 2 +- core/agents/agents_test.go | 2 +- core/agents/lastfm/agent_test.go | 2 +- core/agents/lastfm/client_test.go | 2 +- core/agents/lastfm/lastfm_suite_test.go | 2 +- core/agents/lastfm/responses_test.go | 2 +- core/agents/listenbrainz/agent_test.go | 2 +- core/agents/listenbrainz/auth_router_test.go | 2 +- core/agents/listenbrainz/client_test.go | 2 +- .../listenbrainz/listenbrainz_suite_test.go | 2 +- core/agents/session_keys_test.go | 2 +- core/agents/spotify/client_test.go | 2 +- core/agents/spotify/responses_test.go | 2 +- core/agents/spotify/spotify_suite_test.go | 2 +- core/artwork_test.go | 2 +- core/auth/auth_test.go | 9 +- core/core_suite_test.go | 2 +- core/media_streamer_test.go | 2 +- core/players_test.go | 2 +- core/playlists_test.go | 2 +- core/scrobbler/play_tracker_test.go | 2 +- core/scrobbler/scrobbler_suite_test.go | 2 +- core/share_test.go | 2 +- core/transcoder/transcoder_test.go | 2 +- db/db_test.go | 2 +- go.mod | 8 +- go.sum | 4 +- log/formatters_test.go | 2 +- log/log_test.go | 2 +- model/criteria/criteria_suite_test.go | 2 +- model/criteria/criteria_test.go | 2 +- model/criteria/operators_test.go | 3 +- model/model_suite_test.go | 2 +- persistence/album_repository_test.go | 2 +- persistence/artist_repository_test.go | 2 +- persistence/genre_repository_test.go | 2 +- persistence/helpers_test.go | 2 +- persistence/mediafile_repository_test.go | 2 +- persistence/persistence_suite_test.go | 166 +++++++++--------- persistence/playlist_repository_test.go | 2 +- persistence/playqueue_repository_test.go | 2 +- persistence/property_repository_test.go | 2 +- persistence/sql_base_repository_test.go | 2 +- persistence/sql_bookmarks_test.go | 2 +- persistence/sql_restful_test.go | 2 +- persistence/sql_search_test.go | 2 +- persistence/user_repository_test.go | 2 +- scanner/mapping_test.go | 2 +- scanner/metadata/ffmpeg/ffmpeg_suite_test.go | 2 +- scanner/metadata/ffmpeg/ffmpeg_test.go | 2 +- scanner/metadata/metadata_suite_test.go | 2 +- scanner/metadata/metadata_test.go | 2 +- scanner/metadata/taglib/taglib_suite_test.go | 2 +- scanner/metadata/taglib/taglib_test.go | 2 +- scanner/playlist_importer_test.go | 2 +- scanner/scanner_suite_test.go | 2 +- scanner/tag_scanner_test.go | 2 +- scanner/walk_dir_tree_test.go | 2 +- server/auth_test.go | 2 +- server/events/diode_test.go | 2 +- server/events/events_suite_test.go | 2 +- server/events/events_test.go | 2 +- server/events/sse_test.go | 2 +- server/initial_setup_test.go | 2 +- server/middlewares_test.go | 2 +- server/nativeapi/native_api_suite_test.go | 2 +- server/nativeapi/translations_test.go | 2 +- server/serve_index_test.go | 2 +- server/server_suite_test.go | 2 +- server/subsonic/album_lists_test.go | 2 +- server/subsonic/api_suite_test.go | 2 +- server/subsonic/media_annotation_test.go | 2 +- server/subsonic/media_retrieval_test.go | 2 +- server/subsonic/middlewares_test.go | 2 +- .../responses/responses_suite_test.go | 4 +- server/subsonic/responses/responses_test.go | 2 +- tools.go | 2 +- utils/atomic_test.go | 2 +- utils/cache/cache_suite_test.go | 2 +- utils/cache/file_caches_test.go | 2 +- utils/cache/spread_fs_test.go | 2 +- utils/cached_http_client_test.go | 2 +- utils/context_test.go | 2 +- utils/encrypt_test.go | 2 +- utils/files_test.go | 2 +- utils/gravatar/gravatar_test.go | 2 +- utils/index_group_parser_test.go | 2 +- utils/ints_test.go | 2 +- utils/merge_fs_test.go | 2 +- utils/pool/pool_test.go | 2 +- utils/request_helpers_test.go | 2 +- utils/sanitize_strings_test.go | 2 +- utils/singleton/singleton_test.go | 2 +- utils/strings_test.go | 2 +- utils/time_test.go | 2 +- utils/utils_suite_test.go | 2 +- utils/weighted_random_chooser_test.go | 2 +- 98 files changed, 190 insertions(+), 190 deletions(-) diff --git a/Makefile b/Makefile index 8c42e170..df685661 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ server: check_go_env ##@Development Start the backend in development mode .PHONY: server watch: ##@Development Start Go tests in watch mode (re-run when code changes) - go run github.com/onsi/ginkgo/ginkgo watch -notify ./... + go run github.com/onsi/ginkgo/v2/ginkgo watch -notify ./... .PHONY: watch test: ##@Development Run Go tests @@ -49,7 +49,7 @@ wire: check_go_env ##@Development Update Dependency Injection .PHONY: wire snapshots: ##@Development Update (GoLang) Snapshot tests - UPDATE_SNAPSHOTS=true go run github.com/onsi/ginkgo/ginkgo ./server/subsonic/... + UPDATE_SNAPSHOTS=true go run github.com/onsi/ginkgo/v2/ginkgo ./server/subsonic/... .PHONY: snapshots migration: ##@Development Create an empty migration file diff --git a/core/agents/agents_suite_test.go b/core/agents/agents_suite_test.go index bba05b03..3d225b07 100644 --- a/core/agents/agents_suite_test.go +++ b/core/agents/agents_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/agents_test.go b/core/agents/agents_test.go index b25727b8..f038d637 100644 --- a/core/agents/agents_test.go +++ b/core/agents/agents_test.go @@ -8,7 +8,7 @@ import ( "github.com/navidrome/navidrome/tests" "github.com/navidrome/navidrome/conf" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/lastfm/agent_test.go b/core/agents/lastfm/agent_test.go index 68113eab..1e399c8b 100644 --- a/core/agents/lastfm/agent_test.go +++ b/core/agents/lastfm/agent_test.go @@ -15,7 +15,7 @@ import ( "github.com/navidrome/navidrome/core/scrobbler" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/lastfm/client_test.go b/core/agents/lastfm/client_test.go index 79bb4483..e08955fa 100644 --- a/core/agents/lastfm/client_test.go +++ b/core/agents/lastfm/client_test.go @@ -12,7 +12,7 @@ import ( "os" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/lastfm/lastfm_suite_test.go b/core/agents/lastfm/lastfm_suite_test.go index 9be5fabe..db09226e 100644 --- a/core/agents/lastfm/lastfm_suite_test.go +++ b/core/agents/lastfm/lastfm_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/lastfm/responses_test.go b/core/agents/lastfm/responses_test.go index 62b2aae1..1601e7d4 100644 --- a/core/agents/lastfm/responses_test.go +++ b/core/agents/lastfm/responses_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "os" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/listenbrainz/agent_test.go b/core/agents/listenbrainz/agent_test.go index 6f792831..657d0778 100644 --- a/core/agents/listenbrainz/agent_test.go +++ b/core/agents/listenbrainz/agent_test.go @@ -11,7 +11,7 @@ import ( "github.com/navidrome/navidrome/core/scrobbler" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" ) diff --git a/core/agents/listenbrainz/auth_router_test.go b/core/agents/listenbrainz/auth_router_test.go index 5eb164c9..522369b4 100644 --- a/core/agents/listenbrainz/auth_router_test.go +++ b/core/agents/listenbrainz/auth_router_test.go @@ -10,7 +10,7 @@ import ( "strings" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/listenbrainz/client_test.go b/core/agents/listenbrainz/client_test.go index daeeca3b..a7970431 100644 --- a/core/agents/listenbrainz/client_test.go +++ b/core/agents/listenbrainz/client_test.go @@ -9,7 +9,7 @@ import ( "os" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/listenbrainz/listenbrainz_suite_test.go b/core/agents/listenbrainz/listenbrainz_suite_test.go index 3710f81b..69cb9746 100644 --- a/core/agents/listenbrainz/listenbrainz_suite_test.go +++ b/core/agents/listenbrainz/listenbrainz_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/session_keys_test.go b/core/agents/session_keys_test.go index 84f44066..e0232c08 100644 --- a/core/agents/session_keys_test.go +++ b/core/agents/session_keys_test.go @@ -6,7 +6,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/spotify/client_test.go b/core/agents/spotify/client_test.go index afce3bde..a333cc54 100644 --- a/core/agents/spotify/client_test.go +++ b/core/agents/spotify/client_test.go @@ -7,7 +7,7 @@ import ( "net/http" "os" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/spotify/responses_test.go b/core/agents/spotify/responses_test.go index f8bcfb1b..70411981 100644 --- a/core/agents/spotify/responses_test.go +++ b/core/agents/spotify/responses_test.go @@ -4,7 +4,7 @@ import ( "encoding/json" "os" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/agents/spotify/spotify_suite_test.go b/core/agents/spotify/spotify_suite_test.go index aa199907..1c8038e9 100644 --- a/core/agents/spotify/spotify_suite_test.go +++ b/core/agents/spotify/spotify_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/artwork_test.go b/core/artwork_test.go index 5d1c846c..609b4ce3 100644 --- a/core/artwork_test.go +++ b/core/artwork_test.go @@ -9,7 +9,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/auth/auth_test.go b/core/auth/auth_test.go index ff55e42f..0ac10ebe 100644 --- a/core/auth/auth_test.go +++ b/core/auth/auth_test.go @@ -10,7 +10,7 @@ import ( "github.com/navidrome/navidrome/core/auth" "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -25,10 +25,11 @@ const ( oneDay = 24 * time.Hour ) +var _ = BeforeSuite(func() { + conf.Server.SessionTimeout = 2 * oneDay +}) + var _ = Describe("Auth", func() { - BeforeSuite(func() { - conf.Server.SessionTimeout = 2 * oneDay - }) BeforeEach(func() { auth.Secret = []byte(testJWTSecret) diff --git a/core/core_suite_test.go b/core/core_suite_test.go index 5f2c709d..fdb792d9 100644 --- a/core/core_suite_test.go +++ b/core/core_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/media_streamer_test.go b/core/media_streamer_test.go index 37ecc032..3fedd42c 100644 --- a/core/media_streamer_test.go +++ b/core/media_streamer_test.go @@ -11,7 +11,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/players_test.go b/core/players_test.go index d0440195..22bac558 100644 --- a/core/players_test.go +++ b/core/players_test.go @@ -8,7 +8,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/playlists_test.go b/core/playlists_test.go index 8aafabb7..56486961 100644 --- a/core/playlists_test.go +++ b/core/playlists_test.go @@ -6,7 +6,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/scrobbler/play_tracker_test.go b/core/scrobbler/play_tracker_test.go index 97b5813c..f7412a01 100644 --- a/core/scrobbler/play_tracker_test.go +++ b/core/scrobbler/play_tracker_test.go @@ -12,7 +12,7 @@ import ( "github.com/navidrome/navidrome/model/request" "github.com/navidrome/navidrome/server/events" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/scrobbler/scrobbler_suite_test.go b/core/scrobbler/scrobbler_suite_test.go index d32028ab..6963f6c3 100644 --- a/core/scrobbler/scrobbler_suite_test.go +++ b/core/scrobbler/scrobbler_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/share_test.go b/core/share_test.go index 98f51fee..bc4f6c74 100644 --- a/core/share_test.go +++ b/core/share_test.go @@ -6,7 +6,7 @@ import ( "github.com/deluan/rest" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/core/transcoder/transcoder_test.go b/core/transcoder/transcoder_test.go index 23adfd1f..a91d3b6b 100644 --- a/core/transcoder/transcoder_test.go +++ b/core/transcoder/transcoder_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/db/db_test.go b/db/db_test.go index d2493488..50415260 100644 --- a/db/db_test.go +++ b/db/db_test.go @@ -6,7 +6,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/go.mod b/go.mod index 16e6a44e..826a4555 100644 --- a/go.mod +++ b/go.mod @@ -33,7 +33,7 @@ require ( github.com/microcosm-cc/bluemonday v1.0.17 github.com/mileusna/useragent v1.1.0 github.com/oklog/run v1.1.0 - github.com/onsi/ginkgo v1.16.5 + github.com/onsi/ginkgo/v2 v2.1.4 github.com/onsi/gomega v1.20.0 github.com/pressly/goose v2.7.0+incompatible github.com/robfig/cron/v3 v3.0.1 @@ -113,6 +113,7 @@ require ( github.com/golangci/revgrep v0.0.0-20210930125155-c22e5001d4f2 // indirect github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect github.com/google/go-cmp v0.5.8 // indirect + github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 // indirect github.com/google/subcommands v1.0.1 // indirect github.com/gordonklaus/ineffassign v0.0.0-20210914165742-4cc7213b9bc8 // indirect github.com/gorilla/css v1.0.0 // indirect @@ -166,9 +167,9 @@ require ( github.com/nbutton23/zxcvbn-go v0.0.0-20210217022336-fa2cb2858354 // indirect github.com/nishanths/exhaustive v0.8.1 // indirect github.com/nishanths/predeclared v0.2.2 // indirect - github.com/nxadm/tail v1.4.8 // indirect github.com/ogier/pflag v0.0.1 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect github.com/pelletier/go-toml v1.9.5 // indirect github.com/pelletier/go-toml/v2 v2.0.2 // indirect github.com/phayes/checkstyle v0.0.0-20170904204023-bfd46e6a821d // indirect @@ -223,10 +224,9 @@ require ( golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect - golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect + golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect google.golang.org/protobuf v1.28.0 // indirect gopkg.in/ini.v1 v1.66.6 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect honnef.co/go/tools v0.3.2 // indirect diff --git a/go.sum b/go.sum index cc74d8c6..3dcd8d68 100644 --- a/go.sum +++ b/go.sum @@ -371,6 +371,7 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38 h1:yAJXTCF9TqKcTiHJAE8dj7HMvPfh66eeA2JYW7eFpSE= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/subcommands v1.0.1 h1:/eqq+otEXm5vhfBrbREPCSVQbvofip6kIz+mX5TUH7k= @@ -1100,8 +1101,9 @@ golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 h1:0A+M6Uqn+Eje4kHMK80dtF3JCXC4ykBgQG4Fe06QRhQ= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= +golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/log/formatters_test.go b/log/formatters_test.go index a084c538..61967dc2 100644 --- a/log/formatters_test.go +++ b/log/formatters_test.go @@ -3,7 +3,7 @@ package log import ( "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/log/log_test.go b/log/log_test.go index 42f681b8..3c4cde54 100644 --- a/log/log_test.go +++ b/log/log_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" diff --git a/model/criteria/criteria_suite_test.go b/model/criteria/criteria_suite_test.go index bc26fe1b..9afe9167 100644 --- a/model/criteria/criteria_suite_test.go +++ b/model/criteria/criteria_suite_test.go @@ -5,7 +5,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/navidrome/navidrome/log" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" ) diff --git a/model/criteria/criteria_test.go b/model/criteria/criteria_test.go index 6ac2eb7c..83998922 100644 --- a/model/criteria/criteria_test.go +++ b/model/criteria/criteria_test.go @@ -4,7 +4,7 @@ import ( "bytes" "encoding/json" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" ) diff --git a/model/criteria/operators_test.go b/model/criteria/operators_test.go index fcf41009..2b5f2203 100644 --- a/model/criteria/operators_test.go +++ b/model/criteria/operators_test.go @@ -5,8 +5,7 @@ import ( "fmt" "time" - . "github.com/onsi/ginkgo" - . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" ) diff --git a/model/model_suite_test.go b/model/model_suite_test.go index bc2658e1..fb740b09 100644 --- a/model/model_suite_test.go +++ b/model/model_suite_test.go @@ -6,7 +6,7 @@ import ( _ "github.com/mattn/go-sqlite3" "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/album_repository_test.go b/persistence/album_repository_test.go index 3f67282f..5f1f8b50 100644 --- a/persistence/album_repository_test.go +++ b/persistence/album_repository_test.go @@ -11,7 +11,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/artist_repository_test.go b/persistence/artist_repository_test.go index e00db60c..184d78b9 100644 --- a/persistence/artist_repository_test.go +++ b/persistence/artist_repository_test.go @@ -7,7 +7,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" ) diff --git a/persistence/genre_repository_test.go b/persistence/genre_repository_test.go index 4d3b8fa4..2f5b059d 100644 --- a/persistence/genre_repository_test.go +++ b/persistence/genre_repository_test.go @@ -7,7 +7,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/persistence" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/helpers_test.go b/persistence/helpers_test.go index 3b4469d8..0265a24f 100644 --- a/persistence/helpers_test.go +++ b/persistence/helpers_test.go @@ -6,7 +6,7 @@ import ( "github.com/Masterminds/squirrel" "github.com/navidrome/navidrome/model" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/mediafile_repository_test.go b/persistence/mediafile_repository_test.go index bfb0744f..48578225 100644 --- a/persistence/mediafile_repository_test.go +++ b/persistence/mediafile_repository_test.go @@ -10,7 +10,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/persistence_suite_test.go b/persistence/persistence_suite_test.go index 69f836e2..b184c1c4 100644 --- a/persistence/persistence_suite_test.go +++ b/persistence/persistence_suite_test.go @@ -13,7 +13,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) @@ -79,101 +79,99 @@ func P(path string) string { return filepath.FromSlash(path) } -var _ = Describe("Initialize test DB", func() { +// Initialize test DB +// TODO Load this data setup from file(s) +var _ = BeforeSuite(func() { + o := orm.NewOrm() + ctx := log.NewContext(context.TODO()) + user := model.User{ID: "userid", UserName: "userid"} + ctx = request.WithUser(ctx, user) - // TODO Load this data setup from file(s) - BeforeSuite(func() { - o := orm.NewOrm() - ctx := log.NewContext(context.TODO()) - user := model.User{ID: "userid", UserName: "userid"} - ctx = request.WithUser(ctx, user) + ur := NewUserRepository(ctx, o) + err := ur.Put(&user) + if err != nil { + panic(err) + } - ur := NewUserRepository(ctx, o) - err := ur.Put(&user) + gr := NewGenreRepository(ctx, o) + for i := range testGenres { + g := testGenres[i] + err := gr.Put(&g) if err != nil { panic(err) } + } - gr := NewGenreRepository(ctx, o) - for i := range testGenres { - g := testGenres[i] - err := gr.Put(&g) - if err != nil { - panic(err) - } - } - - mr := NewMediaFileRepository(ctx, o) - for i := range testSongs { - s := testSongs[i] - err := mr.Put(&s) - if err != nil { - panic(err) - } - } - - alr := NewAlbumRepository(ctx, o).(*albumRepository) - for i := range testAlbums { - a := testAlbums[i] - err := alr.Put(&a) - if err != nil { - panic(err) - } - } - - arr := NewArtistRepository(ctx, o) - for i := range testArtists { - a := testArtists[i] - err := arr.Put(&a) - if err != nil { - panic(err) - } - } - - plsBest = model.Playlist{ - Name: "Best", - Comment: "No Comments", - OwnerID: "userid", - OwnerName: "userid", - Public: true, - SongCount: 2, - } - plsBest.AddTracks([]string{"1001", "1003"}) - plsCool = model.Playlist{Name: "Cool", OwnerID: "userid", OwnerName: "userid"} - plsCool.AddTracks([]string{"1004"}) - testPlaylists = []*model.Playlist{&plsBest, &plsCool} - - pr := NewPlaylistRepository(ctx, o) - for i := range testPlaylists { - err := pr.Put(testPlaylists[i]) - if err != nil { - panic(err) - } - } - - // Prepare annotations - if err := arr.SetStar(true, artistBeatles.ID); err != nil { + mr := NewMediaFileRepository(ctx, o) + for i := range testSongs { + s := testSongs[i] + err := mr.Put(&s) + if err != nil { panic(err) } - ar, _ := arr.Get(artistBeatles.ID) - artistBeatles.Starred = true - artistBeatles.StarredAt = ar.StarredAt - testArtists[1] = artistBeatles + } - if err := alr.SetStar(true, albumRadioactivity.ID); err != nil { + alr := NewAlbumRepository(ctx, o).(*albumRepository) + for i := range testAlbums { + a := testAlbums[i] + err := alr.Put(&a) + if err != nil { panic(err) } - al, _ := alr.Get(albumRadioactivity.ID) - albumRadioactivity.Starred = true - albumRadioactivity.StarredAt = al.StarredAt - testAlbums[2] = albumRadioactivity + } - if err := mr.SetStar(true, songComeTogether.ID); err != nil { + arr := NewArtistRepository(ctx, o) + for i := range testArtists { + a := testArtists[i] + err := arr.Put(&a) + if err != nil { panic(err) } - mf, _ := mr.Get(songComeTogether.ID) - songComeTogether.Starred = true - songComeTogether.StarredAt = mf.StarredAt - testSongs[1] = songComeTogether - }) + } + + plsBest = model.Playlist{ + Name: "Best", + Comment: "No Comments", + OwnerID: "userid", + OwnerName: "userid", + Public: true, + SongCount: 2, + } + plsBest.AddTracks([]string{"1001", "1003"}) + plsCool = model.Playlist{Name: "Cool", OwnerID: "userid", OwnerName: "userid"} + plsCool.AddTracks([]string{"1004"}) + testPlaylists = []*model.Playlist{&plsBest, &plsCool} + + pr := NewPlaylistRepository(ctx, o) + for i := range testPlaylists { + err := pr.Put(testPlaylists[i]) + if err != nil { + panic(err) + } + } + + // Prepare annotations + if err := arr.SetStar(true, artistBeatles.ID); err != nil { + panic(err) + } + ar, _ := arr.Get(artistBeatles.ID) + artistBeatles.Starred = true + artistBeatles.StarredAt = ar.StarredAt + testArtists[1] = artistBeatles + + if err := alr.SetStar(true, albumRadioactivity.ID); err != nil { + panic(err) + } + al, _ := alr.Get(albumRadioactivity.ID) + albumRadioactivity.Starred = true + albumRadioactivity.StarredAt = al.StarredAt + testAlbums[2] = albumRadioactivity + + if err := mr.SetStar(true, songComeTogether.ID); err != nil { + panic(err) + } + mf, _ := mr.Get(songComeTogether.ID) + songComeTogether.Starred = true + songComeTogether.StarredAt = mf.StarredAt + testSongs[1] = songComeTogether }) diff --git a/persistence/playlist_repository_test.go b/persistence/playlist_repository_test.go index 37a8242c..58b292a6 100644 --- a/persistence/playlist_repository_test.go +++ b/persistence/playlist_repository_test.go @@ -7,7 +7,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/playqueue_repository_test.go b/persistence/playqueue_repository_test.go index 49089682..2b3da078 100644 --- a/persistence/playqueue_repository_test.go +++ b/persistence/playqueue_repository_test.go @@ -10,7 +10,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/property_repository_test.go b/persistence/property_repository_test.go index d4a589c8..d1aaa3cd 100644 --- a/persistence/property_repository_test.go +++ b/persistence/property_repository_test.go @@ -6,7 +6,7 @@ import ( "github.com/astaxie/beego/orm" "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/sql_base_repository_test.go b/persistence/sql_base_repository_test.go index b88b0af1..42b8bc86 100644 --- a/persistence/sql_base_repository_test.go +++ b/persistence/sql_base_repository_test.go @@ -3,7 +3,7 @@ package persistence import ( "github.com/Masterminds/squirrel" "github.com/navidrome/navidrome/model" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/sql_bookmarks_test.go b/persistence/sql_bookmarks_test.go index 4112b91b..7e54a1f2 100644 --- a/persistence/sql_bookmarks_test.go +++ b/persistence/sql_bookmarks_test.go @@ -7,7 +7,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/sql_restful_test.go b/persistence/sql_restful_test.go index 429813b0..637ac344 100644 --- a/persistence/sql_restful_test.go +++ b/persistence/sql_restful_test.go @@ -3,7 +3,7 @@ package persistence import ( "github.com/Masterminds/squirrel" "github.com/deluan/rest" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/sql_search_test.go b/persistence/sql_search_test.go index 60d4df75..b96c06f2 100644 --- a/persistence/sql_search_test.go +++ b/persistence/sql_search_test.go @@ -1,7 +1,7 @@ package persistence import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/persistence/user_repository_test.go b/persistence/user_repository_test.go index 6792bde3..8baeff57 100644 --- a/persistence/user_repository_test.go +++ b/persistence/user_repository_test.go @@ -9,7 +9,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/mapping_test.go b/scanner/mapping_test.go index 02279b76..f2281c1b 100644 --- a/scanner/mapping_test.go +++ b/scanner/mapping_test.go @@ -6,7 +6,7 @@ import ( "github.com/navidrome/navidrome/conf" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/metadata/ffmpeg/ffmpeg_suite_test.go b/scanner/metadata/ffmpeg/ffmpeg_suite_test.go index 239c86f4..28f9440d 100644 --- a/scanner/metadata/ffmpeg/ffmpeg_suite_test.go +++ b/scanner/metadata/ffmpeg/ffmpeg_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/metadata/ffmpeg/ffmpeg_test.go b/scanner/metadata/ffmpeg/ffmpeg_test.go index 32fb217c..af585273 100644 --- a/scanner/metadata/ffmpeg/ffmpeg_test.go +++ b/scanner/metadata/ffmpeg/ffmpeg_test.go @@ -1,7 +1,7 @@ package ffmpeg import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/metadata/metadata_suite_test.go b/scanner/metadata/metadata_suite_test.go index 25ed29dc..dc2585dd 100644 --- a/scanner/metadata/metadata_suite_test.go +++ b/scanner/metadata/metadata_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/metadata/metadata_test.go b/scanner/metadata/metadata_test.go index 038b957a..de6dd4d1 100644 --- a/scanner/metadata/metadata_test.go +++ b/scanner/metadata/metadata_test.go @@ -2,7 +2,7 @@ package metadata import ( "github.com/navidrome/navidrome/conf" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/metadata/taglib/taglib_suite_test.go b/scanner/metadata/taglib/taglib_suite_test.go index c825817f..31578b93 100644 --- a/scanner/metadata/taglib/taglib_suite_test.go +++ b/scanner/metadata/taglib/taglib_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/metadata/taglib/taglib_test.go b/scanner/metadata/taglib/taglib_test.go index bd71819b..9de0e3ba 100644 --- a/scanner/metadata/taglib/taglib_test.go +++ b/scanner/metadata/taglib/taglib_test.go @@ -1,7 +1,7 @@ package taglib import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/playlist_importer_test.go b/scanner/playlist_importer_test.go index 6ae7c4f0..01cff0cc 100644 --- a/scanner/playlist_importer_test.go +++ b/scanner/playlist_importer_test.go @@ -9,7 +9,7 @@ import ( "github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/scanner_suite_test.go b/scanner/scanner_suite_test.go index 1ff08707..5640bb92 100644 --- a/scanner/scanner_suite_test.go +++ b/scanner/scanner_suite_test.go @@ -8,7 +8,7 @@ import ( "github.com/navidrome/navidrome/db" "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/tag_scanner_test.go b/scanner/tag_scanner_test.go index 0a8edea5..03cfb23e 100644 --- a/scanner/tag_scanner_test.go +++ b/scanner/tag_scanner_test.go @@ -1,7 +1,7 @@ package scanner import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/scanner/walk_dir_tree_test.go b/scanner/walk_dir_tree_test.go index 95a586aa..5b0079e7 100644 --- a/scanner/walk_dir_tree_test.go +++ b/scanner/walk_dir_tree_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing/fstest" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" ) diff --git a/server/auth_test.go b/server/auth_test.go index 566b0476..3709f70d 100644 --- a/server/auth_test.go +++ b/server/auth_test.go @@ -15,7 +15,7 @@ import ( "github.com/navidrome/navidrome/core/auth" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/events/diode_test.go b/server/events/diode_test.go index ad9f2275..50e3dd1a 100644 --- a/server/events/diode_test.go +++ b/server/events/diode_test.go @@ -4,7 +4,7 @@ import ( "context" "code.cloudfoundry.org/go-diodes" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/events/events_suite_test.go b/server/events/events_suite_test.go index 8487745a..b3462f27 100644 --- a/server/events/events_suite_test.go +++ b/server/events/events_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/events/events_test.go b/server/events/events_test.go index 38a13ae4..abfab9b6 100644 --- a/server/events/events_test.go +++ b/server/events/events_test.go @@ -1,7 +1,7 @@ package events import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/events/sse_test.go b/server/events/sse_test.go index 0650a5d5..e6a44ca1 100644 --- a/server/events/sse_test.go +++ b/server/events/sse_test.go @@ -4,7 +4,7 @@ import ( "context" "github.com/navidrome/navidrome/model/request" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/initial_setup_test.go b/server/initial_setup_test.go index ce52c216..982046f7 100644 --- a/server/initial_setup_test.go +++ b/server/initial_setup_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/middlewares_test.go b/server/middlewares_test.go index fa3fb21e..a1ea59dc 100644 --- a/server/middlewares_test.go +++ b/server/middlewares_test.go @@ -5,7 +5,7 @@ import ( "net/http/httptest" "os" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/nativeapi/native_api_suite_test.go b/server/nativeapi/native_api_suite_test.go index d06af718..2f6cb018 100644 --- a/server/nativeapi/native_api_suite_test.go +++ b/server/nativeapi/native_api_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/nativeapi/translations_test.go b/server/nativeapi/translations_test.go index bc3b756b..c49c26c6 100644 --- a/server/nativeapi/translations_test.go +++ b/server/nativeapi/translations_test.go @@ -9,7 +9,7 @@ import ( "github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/resources" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/serve_index_test.go b/server/serve_index_test.go index 00bd88ea..ab88b71d 100644 --- a/server/serve_index_test.go +++ b/server/serve_index_test.go @@ -13,7 +13,7 @@ import ( "github.com/navidrome/navidrome/consts" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/server_suite_test.go b/server/server_suite_test.go index 9677e396..8739c240 100644 --- a/server/server_suite_test.go +++ b/server/server_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/subsonic/album_lists_test.go b/server/subsonic/album_lists_test.go index 0ae1d69f..8266d930 100644 --- a/server/subsonic/album_lists_test.go +++ b/server/subsonic/album_lists_test.go @@ -9,7 +9,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/subsonic/api_suite_test.go b/server/subsonic/api_suite_test.go index 1f7d0777..f4e8a311 100644 --- a/server/subsonic/api_suite_test.go +++ b/server/subsonic/api_suite_test.go @@ -4,7 +4,7 @@ import ( "testing" "github.com/navidrome/navidrome/log" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/subsonic/media_annotation_test.go b/server/subsonic/media_annotation_test.go index ea7fc723..7fd790da 100644 --- a/server/subsonic/media_annotation_test.go +++ b/server/subsonic/media_annotation_test.go @@ -14,7 +14,7 @@ import ( "github.com/navidrome/navidrome/server/events" "github.com/navidrome/navidrome/tests" "github.com/navidrome/navidrome/utils" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/subsonic/media_retrieval_test.go b/server/subsonic/media_retrieval_test.go index b9807599..e85961ec 100644 --- a/server/subsonic/media_retrieval_test.go +++ b/server/subsonic/media_retrieval_test.go @@ -10,7 +10,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/subsonic/middlewares_test.go b/server/subsonic/middlewares_test.go index 5b6ef0d6..5ef7d1b0 100644 --- a/server/subsonic/middlewares_test.go +++ b/server/subsonic/middlewares_test.go @@ -16,7 +16,7 @@ import ( "github.com/navidrome/navidrome/model" "github.com/navidrome/navidrome/model/request" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/server/subsonic/responses/responses_suite_test.go b/server/subsonic/responses/responses_suite_test.go index bf1ff1e4..365316c0 100644 --- a/server/subsonic/responses/responses_suite_test.go +++ b/server/subsonic/responses/responses_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/bradleyjkemp/cupaloy" "github.com/navidrome/navidrome/log" - "github.com/onsi/ginkgo" + "github.com/onsi/ginkgo/v2" "github.com/onsi/gomega" "github.com/onsi/gomega/types" ) @@ -26,7 +26,7 @@ type snapshotMatcher struct { } func (matcher snapshotMatcher) Match(actual interface{}) (success bool, err error) { - err = matcher.c.SnapshotMulti(ginkgo.CurrentGinkgoTestDescription().FullTestText, actual) + err = matcher.c.SnapshotMulti(ginkgo.CurrentSpecReport().FullText(), actual) success = err == nil return } diff --git a/server/subsonic/responses/responses_test.go b/server/subsonic/responses/responses_test.go index c442ad93..bbdc9166 100644 --- a/server/subsonic/responses/responses_test.go +++ b/server/subsonic/responses/responses_test.go @@ -13,7 +13,7 @@ import ( "github.com/navidrome/navidrome/consts" . "github.com/navidrome/navidrome/server/subsonic/responses" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/tools.go b/tools.go index b4305c0e..45806ea2 100644 --- a/tools.go +++ b/tools.go @@ -7,7 +7,7 @@ import ( _ "github.com/cespare/reflex" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/google/wire/cmd/wire" - _ "github.com/onsi/ginkgo/ginkgo" + _ "github.com/onsi/ginkgo/v2/ginkgo" _ "github.com/pressly/goose/cmd/goose" _ "golang.org/x/tools/cmd/goimports" ) diff --git a/utils/atomic_test.go b/utils/atomic_test.go index cf11ed5c..ab3f0959 100644 --- a/utils/atomic_test.go +++ b/utils/atomic_test.go @@ -2,7 +2,7 @@ package utils_test import ( "github.com/navidrome/navidrome/utils" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/cache/cache_suite_test.go b/utils/cache/cache_suite_test.go index b669ce83..7246008b 100644 --- a/utils/cache/cache_suite_test.go +++ b/utils/cache/cache_suite_test.go @@ -5,7 +5,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/cache/file_caches_test.go b/utils/cache/file_caches_test.go index de369123..788dbf43 100644 --- a/utils/cache/file_caches_test.go +++ b/utils/cache/file_caches_test.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/navidrome/navidrome/conf" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/cache/spread_fs_test.go b/utils/cache/spread_fs_test.go index f635eea8..2768ea2d 100644 --- a/utils/cache/spread_fs_test.go +++ b/utils/cache/spread_fs_test.go @@ -5,7 +5,7 @@ import ( "path/filepath" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/cached_http_client_test.go b/utils/cached_http_client_test.go index e927e4ff..0d00b120 100644 --- a/utils/cached_http_client_test.go +++ b/utils/cached_http_client_test.go @@ -8,7 +8,7 @@ import ( "time" "github.com/navidrome/navidrome/consts" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/context_test.go b/utils/context_test.go index be9b5eba..b2a7617e 100644 --- a/utils/context_test.go +++ b/utils/context_test.go @@ -4,7 +4,7 @@ import ( "context" "github.com/navidrome/navidrome/utils" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/encrypt_test.go b/utils/encrypt_test.go index 4615302a..5cd0a8c7 100644 --- a/utils/encrypt_test.go +++ b/utils/encrypt_test.go @@ -4,7 +4,7 @@ import ( "context" "crypto/sha256" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/files_test.go b/utils/files_test.go index cc237ce5..917960c8 100644 --- a/utils/files_test.go +++ b/utils/files_test.go @@ -3,7 +3,7 @@ package utils import ( "path/filepath" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/gravatar/gravatar_test.go b/utils/gravatar/gravatar_test.go index 373ce25c..75c0b840 100644 --- a/utils/gravatar/gravatar_test.go +++ b/utils/gravatar/gravatar_test.go @@ -6,7 +6,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" "github.com/navidrome/navidrome/utils/gravatar" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/index_group_parser_test.go b/utils/index_group_parser_test.go index 47fb804e..8bed12d8 100644 --- a/utils/index_group_parser_test.go +++ b/utils/index_group_parser_test.go @@ -1,7 +1,7 @@ package utils import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/ints_test.go b/utils/ints_test.go index 536cbbb9..7f1ebe13 100644 --- a/utils/ints_test.go +++ b/utils/ints_test.go @@ -1,7 +1,7 @@ package utils import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/merge_fs_test.go b/utils/merge_fs_test.go index a02aeba4..8789ff5b 100644 --- a/utils/merge_fs_test.go +++ b/utils/merge_fs_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "github.com/navidrome/navidrome/utils" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/pool/pool_test.go b/utils/pool/pool_test.go index 73932ef1..f8d723f5 100644 --- a/utils/pool/pool_test.go +++ b/utils/pool/pool_test.go @@ -6,7 +6,7 @@ import ( "github.com/navidrome/navidrome/log" "github.com/navidrome/navidrome/tests" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/request_helpers_test.go b/utils/request_helpers_test.go index ffd964ce..6956a286 100644 --- a/utils/request_helpers_test.go +++ b/utils/request_helpers_test.go @@ -6,7 +6,7 @@ import ( "net/http/httptest" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/sanitize_strings_test.go b/utils/sanitize_strings_test.go index daddc075..393111fc 100644 --- a/utils/sanitize_strings_test.go +++ b/utils/sanitize_strings_test.go @@ -1,7 +1,7 @@ package utils import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/singleton/singleton_test.go b/utils/singleton/singleton_test.go index d8161676..9014e4ef 100644 --- a/utils/singleton/singleton_test.go +++ b/utils/singleton/singleton_test.go @@ -8,7 +8,7 @@ import ( "github.com/google/uuid" "github.com/navidrome/navidrome/utils/singleton" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/strings_test.go b/utils/strings_test.go index d8528313..20a59e16 100644 --- a/utils/strings_test.go +++ b/utils/strings_test.go @@ -2,7 +2,7 @@ package utils import ( "github.com/navidrome/navidrome/conf" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/time_test.go b/utils/time_test.go index 80269008..1f7e0197 100644 --- a/utils/time_test.go +++ b/utils/time_test.go @@ -3,7 +3,7 @@ package utils import ( "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/utils_suite_test.go b/utils/utils_suite_test.go index a88d17d8..847bc965 100644 --- a/utils/utils_suite_test.go +++ b/utils/utils_suite_test.go @@ -3,7 +3,7 @@ package utils import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/utils/weighted_random_chooser_test.go b/utils/weighted_random_chooser_test.go index 0d96daf4..5dae561c 100644 --- a/utils/weighted_random_chooser_test.go +++ b/utils/weighted_random_chooser_test.go @@ -1,7 +1,7 @@ package utils import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" )