Skip to content

Commit

Permalink
[CI VIsibility] Fix the source path for windows (#2778)
Browse files Browse the repository at this point in the history
Co-authored-by: Dario Castañé <[email protected]>
  • Loading branch information
liashenko and darccio authored Jul 10, 2024
1 parent 457de24 commit 70b8a12
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
15 changes: 9 additions & 6 deletions internal/civisibility/integrations/gotesting/testing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,15 @@ func assertCommon(assert *assert.Assertions, span mocktracer.Span) {
assert.Contains(spanTags, constants.RuntimeName)
assert.Contains(spanTags, constants.GitRepositoryURL)
assert.Contains(spanTags, constants.GitCommitSHA)
assert.Contains(spanTags, constants.GitCommitMessage)
assert.Contains(spanTags, constants.GitCommitAuthorEmail)
assert.Contains(spanTags, constants.GitCommitAuthorDate)
assert.Contains(spanTags, constants.GitCommitCommitterEmail)
assert.Contains(spanTags, constants.GitCommitCommitterDate)
assert.Contains(spanTags, constants.GitCommitCommitterName)
// GitHub CI does not provide commit details
if spanTags[constants.CIProviderName] != "github" {
assert.Contains(spanTags, constants.GitCommitMessage)
assert.Contains(spanTags, constants.GitCommitAuthorEmail)
assert.Contains(spanTags, constants.GitCommitAuthorDate)
assert.Contains(spanTags, constants.GitCommitCommitterEmail)
assert.Contains(spanTags, constants.GitCommitCommitterDate)
assert.Contains(spanTags, constants.GitCommitCommitterName)
}
assert.Contains(spanTags, constants.CIWorkspacePath)
}

Expand Down
2 changes: 1 addition & 1 deletion internal/civisibility/utils/environmentTags.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func GetRelativePathFromCITagsSourceRoot(path string) string {
if v, ok := tags[constants.CIWorkspacePath]; ok {
relPath, err := filepath.Rel(v, path)
if err == nil {
return relPath
return filepath.ToSlash(relPath)
}
}

Expand Down

0 comments on commit 70b8a12

Please sign in to comment.