mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
chore(tests): use t.TempDir to create temporary test directory [EE-3700] (#7612)
* create temporary test directory with t.TempDir
This commit is contained in:
parent
1a9d793f2f
commit
a7d458f0bd
36 changed files with 120 additions and 226 deletions
|
@ -188,7 +188,7 @@ func Test_endpointList_edgeDeviceFilter(t *testing.T) {
|
|||
|
||||
func setup(t *testing.T, endpoints []portainer.Endpoint) (handler *Handler, teardown func()) {
|
||||
is := assert.New(t)
|
||||
_, store, teardown := datastore.MustNewTestStore(true, true)
|
||||
_, store, teardown := datastore.MustNewTestStore(t, true, true)
|
||||
|
||||
for _, endpoint := range endpoints {
|
||||
err := store.Endpoint().Create(&endpoint)
|
||||
|
|
|
@ -158,7 +158,7 @@ func runTest(t *testing.T, test filterTest, handler *Handler, endpoints []portai
|
|||
|
||||
func setupFilterTest(t *testing.T, endpoints []portainer.Endpoint) (handler *Handler, teardown func()) {
|
||||
is := assert.New(t)
|
||||
_, store, teardown := datastore.MustNewTestStore(true, true)
|
||||
_, store, teardown := datastore.MustNewTestStore(t, true, true)
|
||||
|
||||
for _, endpoint := range endpoints {
|
||||
err := store.Endpoint().Create(&endpoint)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue