Skip to content

Commit c53fbe1

Browse files
hoegaardenspiffxptothermeJosh HillRandom-Liu
committed
[testing-framework] Bring in testing-framework/integration
This is bringing in https://github.com/kubernetes-sigs/testing_frameworks/tree/694245ac7b60bff90cc8b159fbd8ddb7efe3f218. The package is fully integrated into the local tooling, e.g.: - updated import path - uses the same binary assets for testing - runs its tests as part of `make test` and on prow - updated OWNERS In the original repo the CLA bot was enabled, thus all commits that have been squashed here should be fine regarding the CLA. All authors and committers of the squashed commits have been added here as co-authors. Co-authored-by: Aaron Crickenberger <spiffxp@gmail.com> Co-authored-by: Gareth Smith <gsmith@pivotal.io> Co-authored-by: Hannes Hörl <hhorl@pivotal.io> Co-authored-by: Josh Hill <jhill@pivotal.io> Co-authored-by: Lantao Liu <lantaol@google.com> Co-authored-by: Maru Newby <marun@redhat.com> Co-authored-by: Mengqi Yu <mengqiy@google.com> Co-authored-by: Steven Chung <steve.chung7@gmail.com>
1 parent efbeb27 commit c53fbe1

36 files changed

+1929
-8
lines changed

OWNERS_ALIASES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ aliases:
1111
- shawn-hurley
1212
- gerred
1313
- joelanford
14+
testing-integration-admins:
15+
- apelisse
16+
- hoegaarden
17+
- totherme

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@ require (
2626
k8s.io/apimachinery v0.0.0-20190913080033-27d36303b655
2727
k8s.io/client-go v0.0.0-20190918160344-1fbdaa4c8d90
2828
k8s.io/utils v0.0.0-20190801114015-581e00157fb1
29-
sigs.k8s.io/testing_frameworks v0.1.2
3029
sigs.k8s.io/yaml v1.1.0
3130
)

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,5 @@ modernc.org/strutil v1.0.0/go.mod h1:lstksw84oURvj9y3tn8lGvRxyRC1S2+g5uuIzNfIOBs
381381
modernc.org/xc v1.0.0/go.mod h1:mRNCo0bvLjGhHO9WsyuKVU4q0ceiDDDoEeWDJHrNx8I=
382382
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI=
383383
sigs.k8s.io/structured-merge-diff v0.0.0-20190817042607-6149e4549fca/go.mod h1:IIgPezJWb76P0hotTxzDbWsMYB8APh18qZnxkomBpxA=
384-
sigs.k8s.io/testing_frameworks v0.1.2 h1:vK0+tvjF0BZ/RYFeZ1E6BYBwHJJXhjuZ3TdsEKH+UQM=
385-
sigs.k8s.io/testing_frameworks v0.1.2/go.mod h1:ToQrwSC3s8Xf/lADdZp3Mktcql9CG0UAmdJG9th5i0w=
386384
sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs=
387385
sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o=

hack/check-everything.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,19 @@ SKIP_FETCH_TOOLS=${SKIP_FETCH_TOOLS:-""}
4848

4949
# fetch k8s API gen tools and make it available under kb_root_dir/bin.
5050
function fetch_kb_tools {
51-
header_text "fetching tools"
51+
local dest_dir="${1}"
52+
53+
header_text "fetching tools (into '${dest_dir}')"
5254
kb_tools_archive_name="kubebuilder-tools-$k8s_version-$goos-$goarch.tar.gz"
5355
kb_tools_download_url="https://storage.googleapis.com/kubebuilder-tools/$kb_tools_archive_name"
5456

5557
kb_tools_archive_path="$tmp_root/$kb_tools_archive_name"
5658
if [ ! -f $kb_tools_archive_path ]; then
5759
curl -sL ${kb_tools_download_url} -o "$kb_tools_archive_path"
5860
fi
59-
tar -zvxf "$kb_tools_archive_path" -C "$tmp_root/"
61+
62+
mkdir -p "${dest_dir}"
63+
tar -C "${dest_dir}" --strip-components=1 -zvxf "$kb_tools_archive_path"
6064
}
6165

6266
function is_installed {
@@ -78,7 +82,8 @@ header_text "using tools"
7882

7983
if [ -z "$SKIP_FETCH_TOOLS" ]; then
8084
fetch_go_tools
81-
fetch_kb_tools
85+
fetch_kb_tools "$kb_root_dir"
86+
fetch_kb_tools "${hack_dir}/../pkg/internal/testing/integration/assets"
8287
fi
8388

8489
setup_envs

pkg/builder/builder_suite_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ import (
2828
"k8s.io/apimachinery/pkg/runtime/schema"
2929
"k8s.io/client-go/rest"
3030
"sigs.k8s.io/controller-runtime/pkg/envtest"
31+
"sigs.k8s.io/controller-runtime/pkg/internal/testing/integration/addr"
3132
logf "sigs.k8s.io/controller-runtime/pkg/log"
3233
"sigs.k8s.io/controller-runtime/pkg/log/zap"
3334
"sigs.k8s.io/controller-runtime/pkg/metrics"
3435
"sigs.k8s.io/controller-runtime/pkg/webhook"
35-
"sigs.k8s.io/testing_frameworks/integration/addr"
3636
)
3737

3838
func TestBuilder(t *testing.T) {

pkg/envtest/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import (
2626
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
2727
"k8s.io/client-go/rest"
2828
"sigs.k8s.io/controller-runtime/pkg/client/config"
29-
"sigs.k8s.io/testing_frameworks/integration"
29+
"sigs.k8s.io/controller-runtime/pkg/internal/testing/integration"
3030

3131
logf "sigs.k8s.io/controller-runtime/pkg/internal/log"
3232
)

pkg/internal/testing/OWNERS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# See the OWNERS docs: https://git.k8s.io/community/contributors/devel/owners.md
2+
3+
approvers:
4+
- controller-runtime-admins
5+
- testing-integration-admins
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
assets/bin
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Integration Testing Framework
2+
3+
This package has been moved from [https://github.com/kubernetes-sigs/testing_frameworks/tree/master/integration](https://github.com/kubernetes-sigs/testing_frameworks/tree/master/integration).
4+
5+
A framework for integration testing components of kubernetes. This framework is
6+
intended to work properly both in CI, and on a local dev machine. It therefore
7+
explicitly supports both Linux and Darwin.
8+
9+
For detailed documentation see the
10+
[![GoDoc](https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/internal/testing/integration?status.svg)](https://godoc.org/github.com/kubernetes-sigs/controller-runtime/pkg/internal/testing/integration).
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package addr_test
2+
3+
import (
4+
. "github.com/onsi/ginkgo"
5+
. "github.com/onsi/gomega"
6+
7+
"testing"
8+
)
9+
10+
func TestAddr(t *testing.T) {
11+
t.Parallel()
12+
RegisterFailHandler(Fail)
13+
RunSpecs(t, "Addr Suite")
14+
}

0 commit comments

Comments
 (0)