()
| 38 | } |
| 39 | |
| 40 | func (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 | |
| 63 | func (s *GiteaTestSuite) TearDownTest() { |
| 64 | watcher.CloseWatcher() |
nothing calls this directly
no test coverage detected