Skip to content

Commit df3d5c0

Browse files
authored
Add integration tests and update workflow for testing (#17)
* feat: add integration tests and update workflow for testing * refactor: disable lll linter and clean up integration test variable shadowing * feat: update DeployControllerManager to include image parameter * feat: implement BuildImage function to build Docker image for controller manager * fix: update cache key annotations and test namespace for consistency * fix: reorder BuildImage function call in test environment setup * fix: update test namespace for consistency in integration tests * feat: add integration tests workflow for end-to-end testing * refactor: reorganize integration tests and remove unused cache resources
1 parent 16fb162 commit df3d5c0

File tree

10 files changed

+259
-5
lines changed

10 files changed

+259
-5
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Integration Tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test-e2e:
9+
name: Run on Ubuntu
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Clone the code
13+
uses: actions/checkout@v4
14+
15+
- name: Setup Go
16+
uses: actions/setup-go@v5
17+
with:
18+
go-version-file: go.mod
19+
20+
- name: Running integration tests
21+
run: |
22+
go mod tidy
23+
make test-integration

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ linters:
3030
- gosimple
3131
- govet
3232
- ineffassign
33-
- lll
33+
# - lll
3434
- misspell
3535
- nakedret
3636
- prealloc

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ vet: ## Run go vet against code.
5959

6060
.PHONY: test
6161
test: manifests generate fmt vet setup-envtest ## Run tests.
62-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e) -coverprofile ./cover.out -covermode=atomic -coverpkg=./...
62+
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e | grep -v /integration) -coverprofile ./cover.out -covermode=atomic -coverpkg=./...
6363

6464
# TODO(user): To use a different vendor for e2e tests, modify the setup under 'tests/e2e'.
6565
# The default setup assumes Kind is pre-installed and builds/loads the Manager Docker image locally.
@@ -77,6 +77,10 @@ test-e2e: manifests generate fmt vet ## Run the e2e tests. Expected an isolated
7777
}
7878
go test ./test/e2e/ -v -ginkgo.v
7979

80+
.Phony: test-integration
81+
test-integration: manifests generate fmt vet ## Run the integration tests. Expected an isolated environment using Kind.
82+
go test ./test/integration
83+
8084
.PHONY: lint
8185
lint: golangci-lint ## Run golangci-lint linter
8286
$(GOLANGCI_LINT) run

go.mod

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ require (
1616
k8s.io/apimachinery v0.32.1
1717
k8s.io/client-go v0.32.1
1818
sigs.k8s.io/controller-runtime v0.20.4
19+
sigs.k8s.io/e2e-framework v0.6.0
1920
)
2021

2122
require (
@@ -46,14 +47,17 @@ require (
4647
github.com/google/go-cmp v0.6.0 // indirect
4748
github.com/google/gofuzz v1.2.0 // indirect
4849
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db // indirect
50+
github.com/gorilla/websocket v1.5.0 // indirect
4951
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect
5052
github.com/inconshreveable/mousetrap v1.1.0 // indirect
5153
github.com/josharian/intern v1.0.0 // indirect
5254
github.com/json-iterator/go v1.1.12 // indirect
5355
github.com/mailru/easyjson v0.7.7 // indirect
56+
github.com/moby/spdystream v0.5.0 // indirect
5457
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
5558
github.com/modern-go/reflect2 v1.0.2 // indirect
5659
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
60+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
5761
github.com/pkg/errors v0.9.1 // indirect
5862
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
5963
github.com/prometheus/client_golang v1.19.1 // indirect
@@ -63,6 +67,7 @@ require (
6367
github.com/spf13/cobra v1.8.1 // indirect
6468
github.com/spf13/pflag v1.0.5 // indirect
6569
github.com/stoewer/go-strcase v1.3.0 // indirect
70+
github.com/vladimirvivien/gexe v0.4.1 // indirect
6671
github.com/x448/float16 v0.8.4 // indirect
6772
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect
6873
go.opentelemetry.io/otel v1.28.0 // indirect

go.sum

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cel.dev/expr v0.18.0 h1:CJ6drgk+Hf96lkLikr4rFf19WrU0BOWEihyZnI2TAzo=
22
cel.dev/expr v0.18.0/go.mod h1:MrpN08Q+lEBs+bGYdLxxHkZoUSsCp0nSKTs0nTymJgw=
33
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
44
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
5+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
6+
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
57
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA=
68
github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY=
79
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@@ -67,6 +69,8 @@ github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db h1:097atOisP2aRj7vFgY
6769
github.com/google/pprof v0.0.0-20241029153458-d1b30febd7db/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
6870
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
6971
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
72+
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
73+
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
7074
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0=
7175
github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k=
7276
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
@@ -86,13 +90,17 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
8690
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
8791
github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0=
8892
github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=
93+
github.com/moby/spdystream v0.5.0 h1:7r0J1Si3QO/kjRitvSLVVFUjxMEb/YLj6S9FF62JBCU=
94+
github.com/moby/spdystream v0.5.0/go.mod h1:xBAYlnt/ay+11ShkdFKNAG7LsyK/tmNBVvVOwrfMgdI=
8995
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
9096
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
9197
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
9298
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
9399
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
94100
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA=
95101
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ=
102+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus=
103+
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw=
96104
github.com/onsi/ginkgo/v2 v2.22.0 h1:Yed107/8DjTr0lKCNt7Dn8yQ6ybuDRQoMGrNFKzMfHg=
97105
github.com/onsi/ginkgo/v2 v2.22.0/go.mod h1:7Du3c42kxCUegi0IImZ1wUQzMBVecgIHjR1C+NkhLQo=
98106
github.com/onsi/gomega v1.36.1 h1:bJDPBO7ibjxcbHMgSCoo4Yj18UWbKDlLwX1x9sybDcw=
@@ -130,6 +138,8 @@ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO
130138
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
131139
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
132140
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
141+
github.com/vladimirvivien/gexe v0.4.1 h1:W9gWkp8vSPjDoXDu04Yp4KljpVMaSt8IQuHswLDd5LY=
142+
github.com/vladimirvivien/gexe v0.4.1/go.mod h1:3gjgTqE2c0VyHnU5UOIwk7gyNzZDGulPb/DJPgcw64E=
133143
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
134144
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
135145
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
@@ -243,6 +253,8 @@ sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0 h1:CPT0ExVicCzcp
243253
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.31.0/go.mod h1:Ve9uj1L+deCXFrPOk1LpFXqTg7LCFzFso6PA48q/XZw=
244254
sigs.k8s.io/controller-runtime v0.20.4 h1:X3c+Odnxz+iPTRobG4tp092+CvBU9UK0t/bRf+n0DGU=
245255
sigs.k8s.io/controller-runtime v0.20.4/go.mod h1:xg2XB0K5ShQzAgsoujxuKN4LNXR2LfwwHsPj7Iaw+XY=
256+
sigs.k8s.io/e2e-framework v0.6.0 h1:p7hFzHnLKO7eNsWGI2AbC1Mo2IYxidg49BiT4njxkrM=
257+
sigs.k8s.io/e2e-framework v0.6.0/go.mod h1:IREnCHnKgRCioLRmNi0hxSJ1kJ+aAdjEKK/gokcZu4k=
246258
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 h1:/Rv+M11QRah1itp8VhT6HoVx1Ray9eB4DBr+K+/sCJ8=
247259
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3/go.mod h1:18nIHnGi6636UCz6m8i4DhaJ65T6EruyzmoQqI2BVDo=
248260
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 h1:MdmvkGuXi/8io6ixD5wud3vOLwc1rj0aNqRlpuvjmwA=

internal/utils/controller/const.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package controller
22

33
const (
4-
LabelNameCacheKey = "github.com/Azure/operation-cache-controller/cache-key"
4+
LabelNameCacheKey = "operation-cache-controller.azure.github.com/cache-key"
55
)
66

77
const (
8-
AnnotationNameCacheMode = "github.com/Azure/operation-cache-controller/cache-mode"
9-
AnnotationNameCacheKey = "github.com/Azure/operation-cache-controller/cache-key-annotation"
8+
AnnotationNameCacheMode = "operation-cache-controller.azure.github.com/cache-mode"
9+
AnnotationNameCacheKey = "operation-cache-controller.azure.github.com/cache-key"
1010
AnnotationValueTrue = "true"
1111
AnnotationValueFalse = "false"
1212
)
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
package integration
2+
3+
import (
4+
"context"
5+
"testing"
6+
"time"
7+
8+
"github.com/stretchr/testify/assert"
9+
"k8s.io/apimachinery/pkg/util/wait"
10+
"sigs.k8s.io/e2e-framework/pkg/envconf"
11+
"sigs.k8s.io/e2e-framework/pkg/features"
12+
13+
v1 "github.com/Azure/operation-cache-controller/api/v1"
14+
rqutils "github.com/Azure/operation-cache-controller/internal/utils/controller/requirement"
15+
"github.com/Azure/operation-cache-controller/test/utils"
16+
)
17+
18+
type requirementKey struct{}
19+
20+
const (
21+
testRequirementName = "test-requirement"
22+
)
23+
24+
var CacheFeature = features.New("Simple Requirements").
25+
Setup(func(ctx context.Context, t *testing.T, c *envconf.Config) context.Context {
26+
// start a deployment
27+
requiremnt := utils.NewRequirement(testRequirementName, utils.TestNamespcae)
28+
requiremnt.Namespace = utils.TestNamespcae
29+
if err := c.Client().Resources().Create(ctx, requiremnt); err != nil {
30+
t.Fatal(err)
31+
}
32+
time.Sleep(2 * time.Second)
33+
34+
return ctx
35+
}).
36+
Assess("create requirement", func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
37+
var requirement v1.Requirement
38+
if err := cfg.Client().Resources().Get(ctx, testRequirementName, utils.TestNamespcae, &requirement); err != nil {
39+
t.Fatal(err)
40+
}
41+
assert.Equal(t, testRequirementName, requirement.Name)
42+
if err := wait.PollUntilContextTimeout(ctx, 10*time.Second, 60*time.Second, true, func(ctx context.Context) (bool, error) {
43+
requirement := &v1.Requirement{}
44+
if err := cfg.Client().Resources().Get(ctx, testRequirementName, utils.TestNamespcae, requirement); err != nil {
45+
return false, err
46+
}
47+
if requirement.Status.Phase != rqutils.PhaseReady {
48+
return false, nil
49+
}
50+
return true, nil
51+
}); err != nil {
52+
t.Fatal(err, "operations not ready")
53+
}
54+
return context.WithValue(ctx, requirementKey{}, &requirement)
55+
}).
56+
Teardown(func(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context {
57+
requirement := ctx.Value(requirementKey{}).(*v1.Requirement)
58+
if err := cfg.Client().Resources().Delete(ctx, requirement); err != nil {
59+
t.Fatal(err)
60+
}
61+
return ctx
62+
}).Feature()

test/integration/main_test.go

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package integration
2+
3+
import (
4+
"context"
5+
"fmt"
6+
"os"
7+
"os/exec"
8+
"testing"
9+
10+
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
11+
"k8s.io/client-go/kubernetes/scheme"
12+
"sigs.k8s.io/controller-runtime/pkg/log"
13+
"sigs.k8s.io/controller-runtime/pkg/log/zap"
14+
"sigs.k8s.io/e2e-framework/pkg/env"
15+
"sigs.k8s.io/e2e-framework/pkg/envconf"
16+
"sigs.k8s.io/e2e-framework/pkg/envfuncs"
17+
"sigs.k8s.io/e2e-framework/support/kind"
18+
19+
v1 "github.com/Azure/operation-cache-controller/api/v1"
20+
"github.com/Azure/operation-cache-controller/test/utils"
21+
)
22+
23+
var testenv env.Environment
24+
25+
// projectImage is the name of the image which will be build and loaded
26+
// with the code source changes to be tested.
27+
var projectImage = "example.com/operation-cache-controller:v0.0.1"
28+
var kindClusterName = "integration-test-cluster"
29+
30+
func init() {
31+
log.SetLogger(zap.New(zap.WriteTo(os.Stdout), zap.UseDevMode(true)))
32+
utilruntime.Must(v1.AddToScheme(scheme.Scheme))
33+
}
34+
35+
func TestMain(m *testing.M) {
36+
// Create a new test environment configuration
37+
testenv = env.New()
38+
39+
// Setup the test environment with Kind cluster and necessary resources
40+
testenv = testenv.Setup(
41+
BuildImage,
42+
envfuncs.CreateCluster(kind.NewProvider(), kindClusterName),
43+
envfuncs.LoadDockerImageToCluster(kindClusterName, projectImage),
44+
envfuncs.CreateNamespace(utils.TestNamespcae),
45+
InstallCRD,
46+
DeployControllerManager,
47+
)
48+
49+
// Teardown the test environment
50+
testenv = testenv.Finish(
51+
envfuncs.DeleteNamespace(utils.TestNamespcae),
52+
envfuncs.DestroyCluster(kindClusterName),
53+
)
54+
55+
// Run the tests
56+
os.Exit(testenv.Run(m))
57+
}
58+
59+
func BuildImage(ctx context.Context, cfg *envconf.Config) (context.Context, error) {
60+
// Build the Docker image for the controller manager
61+
cmd := exec.Command("make", "docker-build", fmt.Sprintf("IMG=%s", projectImage))
62+
_, err := utils.Run(cmd)
63+
return ctx, err
64+
}
65+
66+
func InstallCRD(ctx context.Context, cfg *envconf.Config) (context.Context, error) {
67+
// Install the CRD in the test environment
68+
cmd := exec.Command("make", "install")
69+
_, err := utils.Run(cmd)
70+
return ctx, err
71+
}
72+
73+
func DeployControllerManager(ctx context.Context, cfg *envconf.Config) (context.Context, error) {
74+
// Deploy the controller manager in the test environment
75+
cmd := exec.Command("make", "deploy", fmt.Sprintf("IMG=%s", projectImage))
76+
_, err := utils.Run(cmd)
77+
return ctx, err
78+
}
79+
80+
func UninstallCRD(ctx context.Context, cfg *envconf.Config) (context.Context, error) {
81+
// Uninstall the CRD in the test environment
82+
cmd := exec.Command("make", "uninstall")
83+
_, err := utils.Run(cmd)
84+
return ctx, err
85+
}
86+
func TestRealCluster(t *testing.T) {
87+
// Create a new test environment configuration
88+
// Run the integration tests against the Kind cluster
89+
testenv.Test(t, CacheFeature)
90+
}

test/utils/resources.go

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
package utils
2+
3+
import (
4+
appsv1 "github.com/Azure/operation-cache-controller/api/v1"
5+
batchv1 "k8s.io/api/batch/v1"
6+
corev1 "k8s.io/api/core/v1"
7+
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
8+
)
9+
10+
const (
11+
TestNamespcae = "operation-cache-controller-system"
12+
)
13+
14+
func NewTestJobSpec(name string) batchv1.JobSpec {
15+
return batchv1.JobSpec{
16+
Template: corev1.PodTemplateSpec{
17+
ObjectMeta: metav1.ObjectMeta{},
18+
Spec: corev1.PodSpec{
19+
Containers: []corev1.Container{
20+
{
21+
Name: name,
22+
Image: "mcr.microsoft.com/azurelinux/busybox:1.36",
23+
Command: []string{"echo", name + " job"},
24+
},
25+
},
26+
},
27+
},
28+
}
29+
}
30+
31+
func NewTestApplicationSpec(name string) appsv1.ApplicationSpec {
32+
return appsv1.ApplicationSpec{
33+
Name: name,
34+
Provision: NewTestJobSpec("provision"),
35+
Teardown: NewTestJobSpec("teardown"),
36+
}
37+
}
38+
39+
func NewSimpleOperationSpec(name string) *appsv1.OperationSpec {
40+
return &appsv1.OperationSpec{
41+
Applications: []appsv1.ApplicationSpec{NewTestApplicationSpec("app1")},
42+
}
43+
}
44+
45+
func NewRequirement(name, namespace string) *appsv1.Requirement {
46+
return &appsv1.Requirement{
47+
ObjectMeta: metav1.ObjectMeta{
48+
Name: name,
49+
Namespace: namespace,
50+
},
51+
Spec: appsv1.RequirementSpec{
52+
Template: appsv1.OperationSpec{
53+
Applications: []appsv1.ApplicationSpec{NewTestApplicationSpec("app1")},
54+
},
55+
},
56+
}
57+
}

test/utils/utils.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ func GetProjectDir() (string, error) {
198198
return wd, err
199199
}
200200
wd = strings.Replace(wd, "/test/e2e", "", -1)
201+
wd = strings.Replace(wd, "/test/integration", "", -1)
201202
return wd, nil
202203
}
203204

0 commit comments

Comments
 (0)