Skip to content

Commit

Permalink
fix(release-automation): correct guideline mock at runner unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszbarwicki committed Mar 27, 2024
1 parent 21f4a32 commit 71bc25b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions release-automation/internal/test_runner/test_runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ package testrunner
import (
"errors"
"fmt"

"github.com/fatih/color"
"log"
"tractusx-release-automation/internal/exception"
"tractusx-release-automation/internal/repo"
"tractusx-release-automation/internal/tractusx"
Expand All @@ -47,7 +47,7 @@ func (runner *GuidelineTestRunner) Run() error {
config, err := exception.GetData()
exceptionPresent := false
if err != nil {
runner.printer.LogWarning("Can't process exceptions.")
log.Println("Can't process exceptions.")
} else {
repoInfo := repo.GetRepoBaseInfo(guideline.BaseDir())
if config.IsExceptioned(guideline.Name(), "https://github.com/eclipse-tractusx/"+repoInfo.Reponame) {
Expand Down
9 changes: 9 additions & 0 deletions release-automation/internal/test_runner/test_runner_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type Guideline struct {
name string
description string
externalDescription string
baseDir string
isOptional bool
}

Expand All @@ -52,6 +53,10 @@ func (f FailingQualityGuideline) ExternalDescription() string {
return f.externalDescription
}

func (p FailingQualityGuideline) BaseDir() string {
return p.baseDir
}

func (f FailingQualityGuideline) Test() *tractusx.QualityResult {
return &tractusx.QualityResult{Passed: false}
}
Expand All @@ -76,6 +81,10 @@ func (p PassingQualityGuideline) ExternalDescription() string {
return p.externalDescription
}

func (p PassingQualityGuideline) BaseDir() string {
return p.baseDir
}

func (p PassingQualityGuideline) Test() *tractusx.QualityResult {
return &tractusx.QualityResult{Passed: true}
}
Expand Down

0 comments on commit 71bc25b

Please sign in to comment.