Merge pull request #607 from fluxcd/integration-tests
This commit is contained in:
commit
4efca19efb
|
@ -33,8 +33,11 @@ jobs:
|
||||||
# Only run integration tests for main branch
|
# Only run integration tests for main branch
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
echo 'GO_TEST_ARGS="-tags integration"' >> $GITHUB_ENV
|
echo 'GO_TAGS=integration' >> $GITHUB_ENV
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
|
||||||
|
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
|
||||||
run: make test
|
run: make test
|
||||||
- name: Setup Kubernetes
|
- name: Setup Kubernetes
|
||||||
uses: engineerd/setup-kind@v0.5.0
|
uses: engineerd/setup-kind@v0.5.0
|
||||||
|
@ -65,8 +68,11 @@ jobs:
|
||||||
# Only run integration tests for main branch
|
# Only run integration tests for main branch
|
||||||
if: github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: |
|
run: |
|
||||||
echo 'GO_TEST_ARGS="-tags integration"' >> $GITHUB_ENV
|
echo 'GO_TAGS=integration' >> $GITHUB_ENV
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
|
env:
|
||||||
|
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
|
||||||
|
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
|
||||||
run: make test
|
run: make test
|
||||||
- name: Prepare
|
- name: Prepare
|
||||||
id: prep
|
id: prep
|
||||||
|
|
12
Makefile
12
Makefile
|
@ -12,8 +12,8 @@ BUILD_ARGS ?=
|
||||||
# Architectures to build images for
|
# Architectures to build images for
|
||||||
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
|
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
|
||||||
|
|
||||||
# Go test arguments, e.g. '-tags=integration'
|
# Go additional tag arguments, e.g. 'integration'
|
||||||
GO_TEST_ARGS ?=
|
GO_TAGS ?=
|
||||||
|
|
||||||
# Produce CRDs that work back to Kubernetes 1.16
|
# Produce CRDs that work back to Kubernetes 1.16
|
||||||
CRD_OPTIONS ?= crd:crdVersions=v1
|
CRD_OPTIONS ?= crd:crdVersions=v1
|
||||||
|
@ -41,7 +41,7 @@ export CGO_CFLAGS=-I$(LIBGIT2_PATH)/include -I$(LIBGIT2_PATH)/include/openssl
|
||||||
# The pkg-config command will yield warning messages until libgit2 is downloaded.
|
# The pkg-config command will yield warning messages until libgit2 is downloaded.
|
||||||
ifeq ($(shell uname -s),Darwin)
|
ifeq ($(shell uname -s),Darwin)
|
||||||
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null)
|
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null)
|
||||||
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
|
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS))'
|
||||||
else
|
else
|
||||||
export PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH):$(LIBGIT2_LIB64_PATH)/pkgconfig
|
export PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH):$(LIBGIT2_LIB64_PATH)/pkgconfig
|
||||||
export LIBRARY_PATH:=$(LIBRARY_PATH):$(LIBGIT2_LIB64_PATH)
|
export LIBRARY_PATH:=$(LIBRARY_PATH):$(LIBGIT2_LIB64_PATH)
|
||||||
|
@ -53,14 +53,14 @@ ifeq ($(shell uname -s),Linux)
|
||||||
ifeq ($(shell uname -m),x86_64)
|
ifeq ($(shell uname -m),x86_64)
|
||||||
# Linux x86_64 seem to be able to cope with the static libraries
|
# Linux x86_64 seem to be able to cope with the static libraries
|
||||||
# by having only musl-dev installed, without the need of using musl toolchain.
|
# by having only musl-dev installed, without the need of using musl toolchain.
|
||||||
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
|
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS))'
|
||||||
else
|
else
|
||||||
MUSL-PREFIX=$(BUILD_DIR)/musl/$(shell uname -m)-linux-musl-native/bin/$(shell uname -m)-linux-musl
|
MUSL-PREFIX=$(BUILD_DIR)/musl/$(shell uname -m)-linux-musl-native/bin/$(shell uname -m)-linux-musl
|
||||||
MUSL-CC=$(MUSL-PREFIX)-gcc
|
MUSL-CC=$(MUSL-PREFIX)-gcc
|
||||||
export CC=$(MUSL-PREFIX)-gcc
|
export CC=$(MUSL-PREFIX)-gcc
|
||||||
export CXX=$(MUSL-PREFIX)-g++
|
export CXX=$(MUSL-PREFIX)-g++
|
||||||
export AR=$(MUSL-PREFIX)-ar
|
export AR=$(MUSL-PREFIX)-ar
|
||||||
GO_STATIC_FLAGS=-ldflags "-s -w -extldflags \"-static\"" -tags 'netgo,osusergo,static_build'
|
GO_STATIC_FLAGS=-ldflags "-s -w -extldflags \"-static\"" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS))'
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ build: check-deps $(LIBGIT2) ## Build manager binary
|
||||||
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
|
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
|
||||||
test: $(LIBGIT2) install-envtest test-api check-deps ## Run tests
|
test: $(LIBGIT2) install-envtest test-api check-deps ## Run tests
|
||||||
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) \
|
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) \
|
||||||
go test $(GO_STATIC_FLAGS) $(GO_TEST_ARGS) ./... -coverprofile cover.out
|
go test $(GO_STATIC_FLAGS) ./... -coverprofile cover.out
|
||||||
|
|
||||||
check-deps:
|
check-deps:
|
||||||
ifeq ($(shell uname -s),Darwin)
|
ifeq ($(shell uname -s),Darwin)
|
||||||
|
|
|
@ -40,7 +40,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
testTimeout = time.Second * 5
|
testTimeout = time.Second * 10
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Reference in New Issue