Skip to content

Commit

Permalink
fix: model cleanup test init
Browse files Browse the repository at this point in the history
  • Loading branch information
kian99 committed Jan 24, 2025
1 parent 493b8c4 commit 6c7ff62
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/jimm/juju/model_cleanup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,25 +83,20 @@ users:
type modelCleanupSuite struct {
jujuManager *juju.JIMM
jimmAdmin *openfga.User
ofgaClient *openfga.OFGAClient
env *jimmtest.Environment
}

func (s *modelCleanupSuite) Init(c *qt.C) {
ctx := context.Background()
var err error
s.jujuManager = NewTestJujuManager(c, nil)
err = s.jujuManager.Database.Migrate(ctx)
c.Assert(err, qt.IsNil)

i, err := dbmodel.NewIdentity("alice@canonical.com")
c.Assert(err, qt.IsNil)
s.jimmAdmin = openfga.NewUser(i, s.ofgaClient)
s.jimmAdmin = openfga.NewUser(i, s.jujuManager.OpenFGAClient)
s.jimmAdmin.JimmAdmin = true
c.Assert(err, qt.IsNil)

s.env = jimmtest.ParseEnvironment(c, modelPollerTestEnv)
s.env.PopulateDBAndPermissions(c, s.jujuManager.ResourceTag(), s.jujuManager.Database, s.ofgaClient)
s.env.PopulateDBAndPermissions(c, s.jujuManager.ResourceTag(), s.jujuManager.Database, s.jujuManager.OpenFGAClient)
}

func (s *modelCleanupSuite) TestPollModelsDying(c *qt.C) {
Expand Down

0 comments on commit 6c7ff62

Please sign in to comment.