Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwest committed Mar 7, 2024
1 parent 9093ffb commit 4e90204
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 33 deletions.
7 changes: 3 additions & 4 deletions controllers/argocd_metrics_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
corev1 "k8s.io/api/core/v1"
rbacv1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"
Expand All @@ -54,12 +53,12 @@ const (

func newClient(s *runtime.Scheme, namespace, name string) client.Client {
ns := corev1.Namespace{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: namespace,
},
}
argocd := argoapp.ArgoCD{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: name,
Namespace: namespace,
},
Expand Down Expand Up @@ -295,7 +294,7 @@ func TestReconciler_add_dashboard(t *testing.T) {

// Need to create openshift-config-managed namespace for dashboards
ns := corev1.Namespace{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: dashboardNamespace,
},
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/gitopsservice_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ import (
"k8s.io/apimachinery/pkg/api/errors"
resourcev1 "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/kubernetes/scheme"
Expand Down Expand Up @@ -499,7 +498,7 @@ func TestReconcile_testArgoCDForOperatorUpgrade(t *testing.T) {

// Create a basic ArgoCD CR. ArgoCD created by Operator version >= v1.6.0
existingArgoCD := &argoapp.ArgoCD{
ObjectMeta: v1.ObjectMeta{
ObjectMeta: metav1.ObjectMeta{
Name: serviceNamespace,
Namespace: serviceNamespace,
},
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/redhat-developer/gitops-operator
go 1.21

require (
github.com/argoproj-labs/argo-rollouts-manager v0.0.2
github.com/argoproj-labs/argo-rollouts-manager v0.0.2-0.20240221054348-027faa92ffdb
github.com/argoproj-labs/argocd-operator v0.10.0
github.com/coreos/prometheus-operator v0.40.0
github.com/go-logr/logr v1.4.1
Expand Down Expand Up @@ -126,3 +126,5 @@ replace (
k8s.io/sample-cli-plugin => k8s.io/sample-cli-plugin v0.28.3
k8s.io/sample-controller => k8s.io/sample-controller v0.28.3
)

// replace github.com/argoproj-labs/argo-rollouts-manager => ../argo-rollouts-manager
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -637,8 +637,8 @@ github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4x
github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
github.com/argoproj-labs/argo-rollouts-manager v0.0.2 h1:f7V6PP1J9vkhYNsMbCWwB4hHqqgJvs+IbT2RFLsn9ho=
github.com/argoproj-labs/argo-rollouts-manager v0.0.2/go.mod h1:r6/vgsXjS3ZdzfrP8QyDHtoFoKXLbVUIndkPeMzHJGc=
github.com/argoproj-labs/argo-rollouts-manager v0.0.2-0.20240221054348-027faa92ffdb h1:Tza/PynlSFFI4twCW1INWjzU8aCjYMJ0mtoQLQGMsrY=
github.com/argoproj-labs/argo-rollouts-manager v0.0.2-0.20240221054348-027faa92ffdb/go.mod h1:r6/vgsXjS3ZdzfrP8QyDHtoFoKXLbVUIndkPeMzHJGc=
github.com/argoproj-labs/argocd-operator v0.10.0 h1:B2k6Rwiff3O7fG3K7nNiFuo9TV7Kr0s/K9f4Mo+5Qak=
github.com/argoproj-labs/argocd-operator v0.10.0/go.mod h1:4TThdvK88j46P6ybACEhHHqJstdnF+CFHkmlS068dqk=
github.com/argoproj/argo-cd/v2 v2.10.1 h1:VD06GPeoq14Bo7IfiW+EKim3T1C9xaMElVrEtw+zll0=
Expand Down
35 changes: 34 additions & 1 deletion scripts/openshiftci-presubmit-all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,37 @@ chmod 640 $TMP_DIR/kubeconfig
export KUBECONFIG=$TMP_DIR/kubeconfig

# Run e2e test
make test-e2e

# source $(dirname $0)/e2e-common.sh

# # Ensuring proper installation
# pod=openshift-gitops-operator-controller-manager && oc get pods `oc get pods --all-namespaces | grep $pod | head -1 | awk '{print $2}'` -n openshift-gitops-operator -o yaml

# subscription=gitops-operator- && oc get subscription `oc get subscription --all-namespaces | grep $subscription | head -1 | awk '{print $2}'` -n openshift-gitops-operator

# oc wait --for=condition=Ready -n openshift-gitops pod --timeout=15m -l 'app.kubernetes.io/name in (cluster,kam,openshift-gitops-application-controller,openshift-gitops-applicationset-controller,openshift-gitops-dex-server,openshift-gitops-redis,openshift-gitops-repo-server,openshift-gitops-server)'





# ROLLOUTS_TMP_DIR=$(mktemp -d)

# cd $ROLLOUTS_TMP_DIR

# kubectl get namespaces

# kubectl get pods -A || true

# kubectl api-resources

# git clone https://github.com/argoproj-labs/argo-rollouts-manager

# cd "$ROLLOUTS_TMP_DIR/argo-rollouts-manager"

# TARGET_ROLLOUT_MANAGER_COMMIT=027faa92ffdbc43a02eca3982f020a8c391fd340

# git checkout $TARGET_ROLLOUT_MANAGER_COMMIT

# make install generate fmt vet
make test-e2e
68 changes: 45 additions & 23 deletions scripts/run-kuttl-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,27 +109,49 @@ trap cleanup EXIT
# Handle ctrl+c
trap unexpectedError INT

mkdir -p $WORK_DIR/results || exit 1
mkdir -p $DIR/results || exit 1

case "$testsuite" in
"parallel")
header "Running $testsuite tests"
run_parallel $2
;;
"sequential")
header "Running $testsuite tests"
run_sequential $2
;;
"all")
header "Running $testsuite tests"
run_parallel
run_sequential
;;
*)
echo "USAGE: $0 (parallel|sequential|all)" >&2
exit 1
esac

(( failed )) && fail_test "$testsuite tests failed"
success $testsuite

ROLLOUTS_TMP_DIR=$(mktemp -d)

cd $ROLLOUTS_TMP_DIR

kubectl get namespaces

kubectl get pods -A || true

kubectl api-resources

git clone https://github.com/argoproj-labs/argo-rollouts-manager

cd "$ROLLOUTS_TMP_DIR/argo-rollouts-manager"

TARGET_ROLLOUT_MANAGER_COMMIT=027faa92ffdbc43a02eca3982f020a8c391fd340

git checkout $TARGET_ROLLOUT_MANAGER_COMMIT
make test-e2e


# mkdir -p $WORK_DIR/results || exit 1
# mkdir -p $DIR/results || exit 1

# case "$testsuite" in
# "parallel")
# header "Running $testsuite tests"
# run_parallel $2
# ;;
# "sequential")
# header "Running $testsuite tests"
# run_sequential $2
# ;;
# "all")
# header "Running $testsuite tests"
# run_parallel
# run_sequential
# ;;
# *)
# echo "USAGE: $0 (parallel|sequential|all)" >&2
# exit 1
# esac

# (( failed )) && fail_test "$testsuite tests failed"
# success $testsuite

0 comments on commit 4e90204

Please sign in to comment.