Skip to content

Commit

Permalink
Run tests in github action
Browse files Browse the repository at this point in the history
Signed-off-by: Benny Zlotnik <bzlotnik@redhat.com>
  • Loading branch information
bennyz committed Dec 19, 2023
1 parent 7b6a7cd commit 0c8f80d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/go-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: go-test
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test with the Go CLI
run: go test ./...
2 changes: 2 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ jobs:
runs-on: ubuntu-latest
env:
USE_BAZEL_VERSION: 5.4.0
E2E_RUN: true

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checks-out repository under $GITHUB_WORKSPACE
Expand Down
5 changes: 5 additions & 0 deletions tests/suit/tests_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package suit_test
import (
"flag"
"fmt"
"os"
"testing"

"github.com/konveyor/forklift-controller/tests/suit/framework"
Expand Down Expand Up @@ -54,6 +55,10 @@ func TestTests(t *testing.T) {
// flag parsing happens AFTER ginkgo has constructed the entire testing tree. So anything that uses information from flags
// cannot work when called during test tree construction.
func BuildTestSuite() {
if os.Getenv("E2E_RUN") != "true" {
ginkgo.Skip("Not in CI e2e context, skipping e2e tests")
}

BeforeSuite(func() {
fmt.Fprintf(ginkgo.GinkgoWriter, "Reading parameters\n")
// Read flags, and configure client instances
Expand Down

0 comments on commit 0c8f80d

Please sign in to comment.