MCPcopy Create free account
hub / github.com/cloudbase/garm / SetupTest

Method SetupTest

database/sql/gitea_test.go:40–61  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func (s *GiteaTestSuite) SetupTest() {
41 ctx := context.Background()
42 watcher.InitWatcher(ctx)
43 db, err := NewSQLDatabase(ctx, garmTesting.GetTestSqliteDBConfig(s.T()))
44 if err != nil {
45 s.FailNow(fmt.Sprintf("failed to create db connection: %s", err))
46 }
47
48 s.db = db
49
50 createEpParams := params.CreateGiteaEndpointParams{
51 Name: testEndpointName,
52 Description: testEndpointDescription,
53 APIBaseURL: testAPIBaseURL,
54 BaseURL: testBaseURL,
55 }
56 endpoint, err := s.db.CreateGiteaEndpoint(ctx, createEpParams)
57 s.Require().NoError(err)
58 s.Require().NotNil(endpoint)
59 s.Require().Equal(testEndpointName, endpoint.Name)
60 s.giteaEndpoint = endpoint
61}
62
63func (s *GiteaTestSuite) TearDownTest() {
64 watcher.CloseWatcher()

Callers

nothing calls this directly

Calls 3

InitWatcherFunction · 0.92
NewSQLDatabaseFunction · 0.85
CreateGiteaEndpointMethod · 0.65

Tested by

no test coverage detected