Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests add vendor #398

Merged
merged 1 commit into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/_output

# For testing
test_artifacts
test-artifacts

# == kubernetes .gitignore ==

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@ endif

.PHONY: test
test:
go test -v -coverprofile=coverage.out -race $(PKG)/...
go test -v -coverprofile=coverage.out -race $(PKG)/pkg/...
go tool cover -html=coverage.out -o coverage.html

.PHONY: integration
integration:
./hack/test-integration.sh

.PHONY: format
format:
test -z "$$(find . -path ./vendor -prune -type f -o -name '*.go' -exec gofmt -d {} + | tee /dev/stderr)" || \
Expand Down
31 changes: 16 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
module sigs.k8s.io/aws-iam-authenticator

go 1.13
go 1.16

require (
github.com/aws/aws-sdk-go v1.37.1
github.com/aws/aws-sdk-go v1.38.49
github.com/gofrs/flock v0.7.0
github.com/manifoldco/promptui v0.8.0
github.com/prometheus/client_golang v1.1.0
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
github.com/spf13/viper v1.4.0
github.com/prometheus/client_golang v1.11.0
github.com/sirupsen/logrus v1.8.1
github.com/spf13/cobra v1.1.3
github.com/spf13/viper v1.7.0
go.hein.dev/go-version v0.1.0
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4
gopkg.in/yaml.v2 v2.2.8
k8s.io/api v0.16.8
k8s.io/apimachinery v0.16.8
k8s.io/client-go v0.16.8
k8s.io/code-generator v0.16.8
k8s.io/component-base v0.16.8
k8s.io/sample-controller v0.16.8
sigs.k8s.io/yaml v1.1.0
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac
gopkg.in/yaml.v2 v2.4.0
k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver v0.22.1 // indirect
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/code-generator v0.22.1
k8s.io/component-base v0.22.1
k8s.io/sample-controller v0.22.1
sigs.k8s.io/yaml v1.2.0
)
959 changes: 834 additions & 125 deletions go.sum

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions hack/test-integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ function role_arn() {

KUBERNETES_TAG="v1.22.1"
REPO_ROOT="$(cd "$( dirname "${BASH_SOURCE[0]}" )"/.. &> /dev/null && pwd)"
TEST_ARTIFACTS="${TEST_ARTIFACTS:-"${REPO_ROOT}/test_artifacts"}"
TEST_ARTIFACTS="${TEST_ARTIFACTS:-"${REPO_ROOT}/test-artifacts"}"
TEST_ROLE_ARN="${TEST_ROLE_ARN:-$(role_arn)}"

command -v aws || { echo "Command 'aws' not found" && exit 1; }

make clean
make bin

if [[ ! -d ${TEST_ARTIFACTS}/k8s.io/kubernetes ]]; then
Expand All @@ -40,4 +41,6 @@ pushd ${TEST_ARTIFACTS}/k8s.io/kubernetes
make generated_files
popd

go test -v ./tests/integration/server -test-artifacts-dir="${TEST_ARTIFACTS}" -authenticator-binary-path="${REPO_ROOT}/_output/bin/aws-iam-authenticator" -role-arn="${TEST_ROLE_ARN}"
pushd ${REPO_ROOT}/tests/integration
go test -v ./server -test-artifacts-dir="${TEST_ARTIFACTS}" -authenticator-binary-path="${REPO_ROOT}/_output/bin/aws-iam-authenticator" -role-arn="${TEST_ROLE_ARN}"
popd
8 changes: 4 additions & 4 deletions pkg/config/certs/certs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ func stringsEqual(a, b []string) bool {
func TestSelfSignCert(t *testing.T) {
certLifetime := time.Hour * 24 * 365 * 100
tests := []struct {
opts CertOptions
opts CertificateOptions
err error
dnsNames []string
ips []net.IP
}{
{
opts: CertOptions{
opts: CertificateOptions{
Address: "127.0.0.1",
Hostname: "127.0.0.1",
Lifetime: certLifetime,
Expand All @@ -67,7 +67,7 @@ func TestSelfSignCert(t *testing.T) {
ips: []net.IP{net.IPv4(127, 0, 0, 1)},
},
{
opts: CertOptions{
opts: CertificateOptions{
Address: "192.0.2.1",
Hostname: "example.com",
Lifetime: certLifetime,
Expand All @@ -76,7 +76,7 @@ func TestSelfSignCert(t *testing.T) {
ips: []net.IP{net.IPv4(192, 0, 2, 1)},
},
{
opts: CertOptions{
opts: CertificateOptions{
Address: "::",
Hostname: "2001:db8::1:0",
Lifetime: certLifetime,
Expand Down
44 changes: 44 additions & 0 deletions tests/integration/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module sigs.k8s.io/aws-iam-authenticator/tests/integration

go 1.16

require (
github.com/aws/aws-sdk-go v1.38.49
github.com/sirupsen/logrus v1.8.1
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/client-go v0.22.1
k8s.io/kubernetes v1.22.1
sigs.k8s.io/aws-iam-authenticator v0.0.0-00010101000000-000000000000
)

replace (
k8s.io/api => k8s.io/api v0.22.1
k8s.io/apiextensions-apiserver => k8s.io/apiextensions-apiserver v0.22.1
k8s.io/apimachinery => k8s.io/apimachinery v0.22.1
k8s.io/apiserver => k8s.io/apiserver v0.22.1
k8s.io/cli-runtime => k8s.io/cli-runtime v0.22.1
k8s.io/client-go => k8s.io/client-go v0.22.1
k8s.io/cloud-provider => k8s.io/cloud-provider v0.22.1
k8s.io/cluster-bootstrap => k8s.io/cluster-bootstrap v0.22.1
k8s.io/code-generator => k8s.io/code-generator v0.22.1
k8s.io/component-base => k8s.io/component-base v0.22.1
k8s.io/component-helpers => k8s.io/component-helpers v0.22.1
k8s.io/controller-manager => k8s.io/controller-manager v0.22.1
k8s.io/cri-api => k8s.io/cri-api v0.22.1
k8s.io/csi-translation-lib => k8s.io/csi-translation-lib v0.22.1
k8s.io/kube-aggregator => k8s.io/kube-aggregator v0.22.1
k8s.io/kube-controller-manager => k8s.io/kube-controller-manager v0.22.1
k8s.io/kube-proxy => k8s.io/kube-proxy v0.22.1
k8s.io/kube-scheduler => k8s.io/kube-scheduler v0.22.1
k8s.io/kubectl => k8s.io/kubectl v0.22.1
k8s.io/kubelet => k8s.io/kubelet v0.22.1
k8s.io/kubernetes => ../../test-artifacts/k8s.io/kubernetes
k8s.io/legacy-cloud-providers => k8s.io/legacy-cloud-providers v0.22.1
k8s.io/metrics => k8s.io/metrics v0.22.1
k8s.io/mount-utils => k8s.io/mount-utils v0.22.1
k8s.io/pod-security-admission => k8s.io/pod-security-admission v0.22.1
k8s.io/sample-apiserver => k8s.io/sample-apiserver v0.22.1
k8s.io/sample-controller => k8s.io/sample-controller v0.22.1
sigs.k8s.io/aws-iam-authenticator => ../..
)
Loading