Skip to content

Commit 4efca19

Browse files
authored
Merge pull request #607 from fluxcd/integration-tests
2 parents 7c41249 + d17e724 commit 4efca19

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

.github/workflows/e2e.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@ jobs:
3333
# Only run integration tests for main branch
3434
if: github.ref == 'refs/heads/main'
3535
run: |
36-
echo 'GO_TEST_ARGS="-tags integration"' >> $GITHUB_ENV
36+
echo 'GO_TAGS=integration' >> $GITHUB_ENV
3737
- name: Run tests
38+
env:
39+
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
40+
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
3841
run: make test
3942
- name: Setup Kubernetes
4043
uses: engineerd/[email protected]
@@ -65,8 +68,11 @@ jobs:
6568
# Only run integration tests for main branch
6669
if: github.ref == 'refs/heads/main'
6770
run: |
68-
echo 'GO_TEST_ARGS="-tags integration"' >> $GITHUB_ENV
71+
echo 'GO_TAGS=integration' >> $GITHUB_ENV
6972
- name: Run tests
73+
env:
74+
TEST_AZURE_ACCOUNT_NAME: ${{ secrets.TEST_AZURE_ACCOUNT_NAME }}
75+
TEST_AZURE_ACCOUNT_KEY: ${{ secrets.TEST_AZURE_ACCOUNT_KEY }}
7076
run: make test
7177
- name: Prepare
7278
id: prep

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ BUILD_ARGS ?=
1212
# Architectures to build images for
1313
BUILD_PLATFORMS ?= linux/amd64,linux/arm64,linux/arm/v7
1414

15-
# Go test arguments, e.g. '-tags=integration'
16-
GO_TEST_ARGS ?=
15+
# Go additional tag arguments, e.g. 'integration'
16+
GO_TAGS ?=
1717

1818
# Produce CRDs that work back to Kubernetes 1.16
1919
CRD_OPTIONS ?= crd:crdVersions=v1
@@ -41,7 +41,7 @@ export CGO_CFLAGS=-I$(LIBGIT2_PATH)/include -I$(LIBGIT2_PATH)/include/openssl
4141
# The pkg-config command will yield warning messages until libgit2 is downloaded.
4242
ifeq ($(shell uname -s),Darwin)
4343
export CGO_LDFLAGS=$(shell PKG_CONFIG_PATH=$(PKG_CONFIG_PATH) pkg-config --libs --static --cflags libssh2 openssl libgit2 2>/dev/null)
44-
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
44+
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS))'
4545
else
4646
export PKG_CONFIG_PATH:=$(PKG_CONFIG_PATH):$(LIBGIT2_LIB64_PATH)/pkgconfig
4747
export LIBRARY_PATH:=$(LIBRARY_PATH):$(LIBGIT2_LIB64_PATH)
@@ -53,14 +53,14 @@ ifeq ($(shell uname -s),Linux)
5353
ifeq ($(shell uname -m),x86_64)
5454
# Linux x86_64 seem to be able to cope with the static libraries
5555
# by having only musl-dev installed, without the need of using musl toolchain.
56-
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build'
56+
GO_STATIC_FLAGS=-ldflags "-s -w" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS))'
5757
else
5858
MUSL-PREFIX=$(BUILD_DIR)/musl/$(shell uname -m)-linux-musl-native/bin/$(shell uname -m)-linux-musl
5959
MUSL-CC=$(MUSL-PREFIX)-gcc
6060
export CC=$(MUSL-PREFIX)-gcc
6161
export CXX=$(MUSL-PREFIX)-g++
6262
export AR=$(MUSL-PREFIX)-ar
63-
GO_STATIC_FLAGS=-ldflags "-s -w -extldflags \"-static\"" -tags 'netgo,osusergo,static_build'
63+
GO_STATIC_FLAGS=-ldflags "-s -w -extldflags \"-static\"" -tags 'netgo,osusergo,static_build$(addprefix ,,$(GO_TAGS))'
6464
endif
6565
endif
6666

@@ -96,7 +96,7 @@ build: check-deps $(LIBGIT2) ## Build manager binary
9696
KUBEBUILDER_ASSETS?="$(shell $(ENVTEST) --arch=$(ENVTEST_ARCH) use -i $(ENVTEST_KUBERNETES_VERSION) --bin-dir=$(ENVTEST_ASSETS_DIR) -p path)"
9797
test: $(LIBGIT2) install-envtest test-api check-deps ## Run tests
9898
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS) \
99-
go test $(GO_STATIC_FLAGS) $(GO_TEST_ARGS) ./... -coverprofile cover.out
99+
go test $(GO_STATIC_FLAGS) ./... -coverprofile cover.out
100100

101101
check-deps:
102102
ifeq ($(shell uname -s),Darwin)

pkg/azure/blob_integration_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import (
4040
)
4141

4242
var (
43-
testTimeout = time.Second * 5
43+
testTimeout = time.Second * 10
4444
)
4545

4646
var (

0 commit comments

Comments
 (0)