chore(unit-test): simplify teardown EE-5536 (#9015)

This commit is contained in:
andres-portainer
2023-05-30 11:02:22 -03:00
committed by GitHub
parent b498cd657f
commit eda07614ce
37 changed files with 110 additions and 218 deletions

View File

@@ -22,8 +22,7 @@ import (
func Test_helmDelete(t *testing.T) {
is := assert.New(t)
_, store, teardown := datastore.MustNewTestStore(t, true, true)
defer teardown()
_, store := datastore.MustNewTestStore(t, true, true)
err := store.Endpoint().Create(&portainer.Endpoint{ID: 1})
is.NoError(err, "Error creating environment")

View File

@@ -25,8 +25,7 @@ import (
func Test_helmInstall(t *testing.T) {
is := assert.New(t)
_, store, teardown := datastore.MustNewTestStore(t, true, true)
defer teardown()
_, store := datastore.MustNewTestStore(t, true, true)
err := store.Endpoint().Create(&portainer.Endpoint{ID: 1})
is.NoError(err, "error creating environment")

View File

@@ -24,8 +24,7 @@ import (
func Test_helmList(t *testing.T) {
is := assert.New(t)
_, store, teardown := datastore.MustNewTestStore(t, true, true)
defer teardown()
_, store := datastore.MustNewTestStore(t, true, true)
err := store.Endpoint().Create(&portainer.Endpoint{ID: 1})
assert.NoError(t, err, "error creating environment")