Skip to content

Commit

Permalink
Merge pull request #3715 from werf/tests_fix_failed_tests
Browse files Browse the repository at this point in the history
tests: fix failed suites
  • Loading branch information
alexey-igrychev committed Sep 15, 2021
2 parents e95f78d + 955578f commit 1ac3d40
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Expand Up @@ -7,6 +7,7 @@ import (
"strings"
"sync"

"github.com/gookit/color"
"github.com/otiai10/copy"
"github.com/werf/werf/integration/pkg/utils"
"github.com/werf/werf/integration/pkg/utils/liveexec"
Expand All @@ -30,16 +31,13 @@ func ExtractStageInfoFromOutputLine(stageInfo *StageInfo, line string) *StageInf
}

fields := strings.Fields(line)
if strings.Contains(line, "image_id: ") {
if strings.Contains(line, "id: ") {
stageInfo.ImageID = fields[len(fields)-1]
}
if strings.Contains(line, "repository: ") {
stageInfo.Repository = fields[len(fields)-1]
}
if strings.Contains(line, "name: ") {
nameParts := strings.Split(fields[len(fields)-1], ":")
stageInfo.Repository = nameParts[0]
stageInfo.Tag = nameParts[1]
stageInfo.Repository = color.ClearCode(nameParts[0])
stageInfo.Tag = color.ClearCode(nameParts[1])

sigAndID := strings.SplitN(stageInfo.Tag, "-", 2)
stageInfo.Digest = sigAndID[0]
Expand Down
10 changes: 6 additions & 4 deletions pkg/true_git/service_branch_test.go
Expand Up @@ -243,9 +243,10 @@ var _ = Describe("SyncSourceWorktreeWithServiceBranch", func() {
"git",
"show", serviceCommit+":"+trackedFileRelPath,
)

Ω(err).Should(HaveOccurred())
Ω(string(bytes)).Should(Equal(fmt.Sprintf("fatal: Path '%s' does not exist in '%s'\n", trackedFileRelPath, serviceCommit)))

output := string(bytes)
Ω(output).Should(ContainSubstring(fmt.Sprintf("'%s' does not exist in '%s'", trackedFileRelPath, serviceCommit)))
})
})
})
Expand Down Expand Up @@ -309,9 +310,10 @@ var _ = Describe("SyncSourceWorktreeWithServiceBranch", func() {
"git",
"show", serviceCommit+":"+untrackedFileRelPath,
)

Ω(err).Should(HaveOccurred())
Ω(string(bytes)).Should(Equal(fmt.Sprintf("fatal: Path '%s' exists on disk, but not in '%s'.\n", untrackedFileRelPath, serviceCommit)))

output := string(bytes)
Ω(output).Should(ContainSubstring(fmt.Sprintf("'%s' exists on disk, but not in '%s'", untrackedFileRelPath, serviceCommit)))
})
})
})

0 comments on commit 1ac3d40

Please sign in to comment.