Skip to content

Commit

Permalink
Test github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
yersan committed Apr 25, 2024
1 parent 3ab631c commit cf853bb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
minikube image load --pull=true quay.io/wildfly-quickstarts/wildfly-operator-quickstart:bootable-21.0
minikube image load --pull=true quay.io/wildfly-quickstarts/clusterbench:latest
- name: Containerized End-to-End Tests
run: eval $(minikube -p minikube docker-env) && make test-e2e-minikube
run: minikube addons enable registry && make test-e2e-minikube
- name: Docker Login to Quay.io (main only)
uses: docker/[email protected]
if: github.ref == 'refs/heads/main'
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test-e2e: prepare-test-e2e run-test-e2e ## Run E2E tests running the Operator as
## Run E2E tests running the Operator as a Deployment inside a local minikube cluster installation.
.PHONY: test-e2e-minikube
test-e2e-minikube: prepare-test-e2e
docker run -d -p 5000:5000 --restart=always --name image-registry registry || true
docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
IMG="localhost:5000/wildfly-operator:latest" make docker-build docker-push run-test-e2e

.PHONY: prepare-test-e2e
Expand All @@ -142,7 +142,7 @@ run-test-e2e:
$(KUSTOMIZE) build config/rbac | kubectl apply -f -
mkdir -p dry-run
$(KUSTOMIZE) build config/tests > dry-run/test-resources.yaml
LOCAL_MANAGER=0 go test -timeout 20m -v ./test/e2e/... -coverprofile cover.out
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" LOCAL_MANAGER=0 go test -timeout 20m -v ./test/e2e/... -coverprofile cover.out
$(KUSTOMIZE) build config/rbac | kubectl delete --ignore-not-found=true -f -

.PHONY: clean
Expand Down
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: quay.io/wildfly/wildfly-operator
newName: localhost:5000/wildfly-operator
newTag: latest
6 changes: 3 additions & 3 deletions test/e2e/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
wildflyv1alpha1 "github.com/wildfly/wildfly-operator/api/v1alpha1"
"github.com/wildfly/wildfly-operator/controllers"
"io"
"io/ioutil"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
Expand All @@ -38,6 +37,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"log"
"os"
"path/filepath"
Expand Down Expand Up @@ -94,7 +94,7 @@ var _ = BeforeSuite(func() {

log.Printf("Start testing deploying the Operator")
testEnv = &envtest.Environment{
UseExistingCluster: pointer.BoolPtr(true),
UseExistingCluster: ptr.To(true),
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
CRDInstallOptions: envtest.CRDInstallOptions{CleanUpAfterUse: true},
ErrorIfCRDPathMissing: true,
Expand All @@ -104,7 +104,7 @@ var _ = BeforeSuite(func() {
cfg, k8sClient = initialSetup()

// load resources for tests generated by kustomize
data, err := ioutil.ReadFile("../../dry-run/test-resources.yaml")
data, err := os.ReadFile("../../dry-run/test-resources.yaml")
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit cf853bb

Please sign in to comment.