Skip to content

Commit

Permalink
Testspace (#4592)
Browse files Browse the repository at this point in the history
* Publish to testspace
* Update gitignore
* Add changelog
* Run tests on merge to master
* Add junit to test suites
* Don't run codegen on master every time
* Don't repeat codegen
  • Loading branch information
Kevin Dorosh committed Apr 14, 2021
1 parent e85556f commit b504ffc
Show file tree
Hide file tree
Showing 142 changed files with 480 additions and 171 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/codegen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI
on: pull_request
jobs:
codegen:
name: codegen check
runs-on: ubuntu-18.04
steps:
- name: Cancel Previous Actions
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Install Protoc
uses: arduino/setup-protoc@v1.1.2
with:
version: '3.6.1'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Generate Code
run: |
./ci/check-generated-code.sh
Original file line number Diff line number Diff line change
@@ -1,37 +1,10 @@
name: CI
on: pull_request
on:
push:
branches:
- 'master'
pull_request:
jobs:
codegen:
name: codegen check
runs-on: ubuntu-18.04
steps:
- name: Cancel Previous Actions
uses: styfle/cancel-workflow-action@0.4.1
with:
access_token: ${{ github.token }}
- name: Set up Go 1.14
uses: actions/setup-go@v1
with:
go-version: 1.14
id: go
- name: Install Protoc
uses: arduino/setup-protoc@v1.1.2
with:
version: '3.6.1'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Generate Code
run: |
./ci/check-generated-code.sh
regression_tests:
name: k8s regression tests
runs-on: ubuntu-18.04
Expand Down Expand Up @@ -78,6 +51,14 @@ jobs:
KUBE2E_TESTS: ${{ matrix.kube-e2e-test-type }}
run: |
make run-ci-regression-tests
- uses: testspace-com/setup-testspace@v1
with:
domain: solo-io.testspace.com
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Push result to Testspace server
run: |
testspace */junit.xml
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
- name: Debug Info
if: failure()
run: |
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ old_docs_temp_dir/
.vscode/launch.json
.vscode/settings.json

# junit
*/junit.xml
3 changes: 3 additions & 0 deletions changelog/v1.8.0-beta8/testspace.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
changelog:
- type: NON_USER_FACING
description: Set up testspace
5 changes: 4 additions & 1 deletion docs/cmd/test/generate_changelog_doc_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/solo-io/go-utils/testutils"
Expand All @@ -11,5 +13,6 @@ import (
func TestGenerateChangelogDoc(t *testing.T) {
RegisterFailHandler(Fail)
testutils.RegisterCommonFailHandlers()
RunSpecs(t, "Generate Changelog Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Generate Changelog Suite", []Reporter{junitReporter})
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ package securityscanutils_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/solo-io/go-utils/testutils"
)

func TestGenerateSecuritScanDoc(t *testing.T) {
func TestGenerateSecurityScanDoc(t *testing.T) {
RegisterFailHandler(Fail)
testutils.RegisterCommonFailHandlers()
RunSpecs(t, "Generate Security Scan Docs Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Generate Security Scan Docs Suite", []Reporter{junitReporter})
}
5 changes: 4 additions & 1 deletion install/test/helm_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import (
"testing"
"text/template"

"github.com/onsi/ginkgo/reporters"

"github.com/ghodss/yaml"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -36,7 +38,8 @@ import (
func TestHelm(t *testing.T) {
RegisterFailHandler(Fail)
testutils.RegisterCommonFailHandlers()
RunSpecs(t, "Helm Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Helm Suite", []Reporter{junitReporter})
}

var _ = BeforeSuite(func() {
Expand Down
5 changes: 4 additions & 1 deletion jobs/pkg/kube/kube_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package kube_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestKube(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Kube Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Kube Suite", []Reporter{junitReporter})
}
5 changes: 4 additions & 1 deletion pkg/cliutil/cliutil_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package cliutil_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestCliutil(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Cliutil Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Cliutil Suite", []Reporter{junitReporter})
}
5 changes: 4 additions & 1 deletion pkg/cliutil/nsselect/nsutil_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package nsselect_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestGit(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "NsSelect Test")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "NsSelect Test", []Reporter{junitReporter})
}
5 changes: 4 additions & 1 deletion pkg/utils/channelutils/channelutils_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package channelutils_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestChannelutils(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Channelutils Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Channelutils Suite", []Reporter{junitReporter})
}
5 changes: 4 additions & 1 deletion pkg/utils/regexutils/regex_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package regexutils_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestRegex(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Regex Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Regex Suite", []Reporter{junitReporter})
}
5 changes: 4 additions & 1 deletion pkg/utils/selectionutils/selectionutils_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ package selectionutils_test
import (
"testing"

"github.com/onsi/ginkgo/reporters"

. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)

func TestSelectionUtils(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Selection utils Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Selection utils Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion pkg/utils/settingsutil/settings_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestSettings(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Settings Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Settings Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion pkg/utils/setuputils/setuputils_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestSetuputils(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Setuputils Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Setuputils Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion pkg/utils/syncutil/syncutil_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestSyncUtils(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Sync Utils Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Sync Utils Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion pkg/utils/utils_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestUtils(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Utils Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Utils Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion pkg/version/version_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestVersion(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Version Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Version Suite", []Reporter{junitReporter})
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestStatusSyncer(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "StatusSyncer Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "StatusSyncer Suite", []Reporter{junitReporter})
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
_ "k8s.io/client-go/plugin/pkg/client/auth/gcp"
)

func TestTranslator(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Translator Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Translator Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion projects/discovery/pkg/fds/pkg_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestPkg(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Pkg Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Pkg Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion projects/discovery/pkg/fds/syncer/syncer_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestSyncer(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Syncer Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Syncer Suite", []Reporter{junitReporter})
}
4 changes: 3 additions & 1 deletion projects/envoyinit/pkg/downward/downward_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ import (
"testing"

. "github.com/onsi/ginkgo"
"github.com/onsi/ginkgo/reporters"
. "github.com/onsi/gomega"
)

func TestDownward(t *testing.T) {
RegisterFailHandler(Fail)
RunSpecs(t, "Downward Suite")
junitReporter := reporters.NewJUnitReporter("junit.xml")
RunSpecsWithDefaultAndCustomReporters(t, "Downward Suite", []Reporter{junitReporter})
}
Loading

0 comments on commit b504ffc

Please sign in to comment.