Skip to content

Commit

Permalink
test: Migrate Backend tests to a GHA workflow (#10871)
Browse files Browse the repository at this point in the history
Signed-off-by: ddalvi <ddalvi@redhat.com>
  • Loading branch information
DharmitD authored Jun 5, 2024
1 parent 4e9fe75 commit 8bcfb3d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/presubmit-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: KFP Backend Tests

on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
- 'backend/**'
- 'test/presubmit-backend-test.sh'

jobs:
backend-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.21'

- name: Run Backend Tests
run: ./test/presubmit-backend-test.sh
8 changes: 4 additions & 4 deletions test/presubmit-backend-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ set -ex

# Add installed go binaries to PATH.
export PATH="${PATH}:$(go env GOPATH)/bin"
# The current directory is /home/prow/go/src/github.com/kubeflow/pipelines
cd /home/prow/go/src/github.com/kubeflow/pipelines

# 1. Check go modules are tidy
# Reference: https://github.com/golang/go/issues/27005#issuecomment-564892876
go mod download
go mod tidy
git diff --exit-code -- go.mod go.sum || (echo "go modules are not tidy, run 'go mod tidy'." && exit 1)
# 2. run test in project directory

# 2. Run tests in the backend directory
go test -v -cover ./backend/...

# 3. Check for forbidden go licenses
./hack/install-go-licenses.sh
go-licenses check ./backend/src/apiserver ./backend/src/cache ./backend/src/agent/persistence ./backend/src/crd/controller/scheduledworkflow ./backend/src/crd/controller/viewer

0 comments on commit 8bcfb3d

Please sign in to comment.