Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCM-7614 | fix: Get the merged commit but not the pull request commit #1965

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion images/Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . .
RUN go install ./cmd/rosa
RUN go test -c -o /go/bin/rosatest ./tests/e2e
RUN rosa verify openshift-client
RUN rosatest --ginkgo.label-filter "e2e-commit"
RUN rosatest --ginkgo.no-color --ginkgo.label-filter "e2e-commit"

FROM registry.ci.openshift.org/ci/cli-ocm:latest as ocmcli

Expand Down
6 changes: 4 additions & 2 deletions tests/e2e/e2e_pre_check_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import (

var _ = Describe("PreCheck", func() {
It("commits-focus", labels.E2ECommit, func() {
author, err := rosacli.GetCommitAuthor()
_, err := rosacli.GetCommitAuthor()
Expect(err).ToNot(HaveOccurred())

focus, err := rosacli.GetCommitFoucs()
Expect(err).ToNot(HaveOccurred())
fmt.Printf("[%s] Focus: %v\n", author, focus)
if focus != "" {
fmt.Printf("The latest commit updates the test: %s\n", focus)
}
})
})
4 changes: 2 additions & 2 deletions tests/utils/exec/rosacli/pr_check.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func GetCommitAuthor() (string, error) {
command := "git log -n 1 --pretty=format:%an"
command := "git log -n 1 --no-merges --pretty=format:%an"
runner := NewRunner()

output, err := runner.RunCMD(strings.Split(command, " "))
Expand All @@ -21,7 +21,7 @@ func GetCommitAuthor() (string, error) {
}

func GetCommitFoucs() (string, error) {
command := "git log -n 1 --pretty=format:%s"
command := "git log -n 1 --no-merges --pretty=format:%s"
runner := NewRunner()

output, err := runner.RunCMD(strings.Split(command, " "))
Expand Down