• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mendersoftware / integration-test-runner / 757087774

pending completion
757087774

Pull #211

gitlab-ci

Alex Miliukov
test: unit tests for features enable/disable option
Pull Request #211: QA-518: add list of repos to sync option

31 of 42 new or added lines in 2 files covered. (73.81%)

19 existing lines in 1 file now uncovered.

1810 of 2387 relevant lines covered (75.83%)

4.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

59.09
/main_push.go
1
package main
2

3
import (
4
        "github.com/gin-gonic/gin"
5
        "github.com/google/go-github/v28/github"
6

7
        clientgithub "github.com/mendersoftware/integration-test-runner/client/github"
8
)
9

10
func processGitHubPush(
11
        ctx *gin.Context,
12
        push *github.PushEvent,
13
        githubClient clientgithub.Client,
14
        conf *config,
15
) error {
3✔
16
        log := getCustomLoggerFromContext(ctx)
3✔
17

3✔
18
        repoName := push.GetRepo().GetName()
3✔
19
        repoOrg := push.GetRepo().GetOrganization()
3✔
20
        refName := push.GetRef()
3✔
21

3✔
22
        if len(conf.reposSyncList) == 0 || isRepoManaged(repoName, conf.reposSyncList) {
6✔
23
                log.Debugf("Got push event :: repo %s :: ref %s", repoName, refName)
3✔
24

3✔
25
                err := syncRemoteRef(log, repoOrg, repoName, refName, conf)
3✔
26
                if err != nil {
3✔
NEW
27
                        log.Errorf("Could not sync branch: %s", err.Error())
×
NEW
28
                        return err
×
NEW
29
                }
×
30
        }
31
        return nil
3✔
32
}
33

NEW
34
func isRepoManaged(repo string, reposList []string) bool {
×
NEW
35
        for _, r := range reposList {
×
NEW
36
                if r == repo {
×
NEW
37
                        return true
×
NEW
38
                }
×
39
        }
NEW
40
        return false
×
41
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc