Skip to content

Commit

Permalink
chore: refer correct tkn yaml in prow test (knative#1918)
Browse files Browse the repository at this point in the history
Without this change prow test will refer tkn yamls from the main branch
not from the PR head branch.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
  • Loading branch information
matejvasek committed Sep 27, 2023
1 parent d90e55d commit 24928c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-unit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ jobs:
java-version: ${{ matrix.java }}
- name: Core Unit Tests
run: make test
env:
FUNC_REPO_REF: ${{ github.event.pull_request.head.repo.full_name }}
FUNC_REPO_BRANCH_REF: ${{ github.head_ref }}
- name: Template Unit Tests
run: make test-templates
- uses: codecov/codecov-action@v3
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $(BIN): $(CODE)
env CGO_ENABLED=0 go build -ldflags $(LDFLAGS) ./cmd/$(BIN)

test: $(CODE) ## Run core unit tests
go test -race -cover -coverprofile=coverage.txt ./...
go test -ldflags $(LDFLAGS) -race -cover -coverprofile=coverage.txt ./...

.PHONY: check
check: $(BIN_GOLANGCI_LINT) ## Check code quality (lint)
Expand Down
9 changes: 6 additions & 3 deletions test/presubmit-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export NODE_DISTRO=linux-x64

export KNATIVE_SERVING_VERSION=${KNATIVE_SERVING_VERSION:-latest}
export KNATIVE_EVENTING_VERSION=${KNATIVE_EVENTING_VERSION:-latest}
source $(dirname $0)/../vendor/knative.dev/hack/presubmit-tests.sh
source "$(dirname "$0")/../vendor/knative.dev/hack/presubmit-tests.sh"

FUNC_REPO_BRANCH_REF="${PULL_PULL_SHA}"
export FUNC_REPO_BRANCH_REF

function post_build_tests() {
local failed=0
Expand Down Expand Up @@ -71,7 +74,7 @@ function unit_tests() {
make test || failed=1
if (( failed )); then
results_banner "Unit tests failed"
exit ${failed}
exit "${failed}"
fi
template_tests
}
Expand All @@ -81,7 +84,7 @@ function template_tests() {
make test-templates || failed=2
if (( failed )); then
results_banner "Built-in template tests failed"
exit ${failed}
exit "${failed}"
fi
}

Expand Down

0 comments on commit 24928c4

Please sign in to comment.