Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
jgwest committed Feb 22, 2024
1 parent b125af9 commit 67a9464
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 34 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
5 changes: 4 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.20

require (
github.com/argoproj-labs/argo-rollouts-manager v0.0.2-0.20230515023837-0632f3e856d5
github.com/argoproj-labs/argo-rollouts-manager v0.0.2-0.20240221054348-027faa92ffdb
github.com/argoproj-labs/argocd-operator v0.9.0-rc1
github.com/coreos/prometheus-operator v0.40.0
github.com/go-logr/logr v1.2.4
Expand All @@ -27,6 +27,7 @@ require (

require (
github.com/argoproj/argo-cd/v2 v2.9.2 // indirect
github.com/argoproj/argo-rollouts v1.6.6 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand Down Expand Up @@ -124,3 +125,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
8 changes: 5 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -637,12 +637,14 @@ 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-0.20230515023837-0632f3e856d5 h1:SlFbeNb42H7DUGzE9B/uYYjlQjNSR4y+eaWiTqN3PGs=
github.com/argoproj-labs/argo-rollouts-manager v0.0.2-0.20230515023837-0632f3e856d5/go.mod h1:AiEjAr6e/DCDiicjoC7W7LaZdO28sfgoBhjbGryzEZ8=
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.9.0-rc1 h1:1iPeIHSZWva/z3h+EWps9GJdH27t6GbWiN3sKTn4rTg=
github.com/argoproj-labs/argocd-operator v0.9.0-rc1/go.mod h1:vypqFDqVCcJXK4xFV4XQrCGRlHHWl8YsjKuuRMgATRY=
github.com/argoproj/argo-cd/v2 v2.9.2 h1:WJFLZOESdrigOcj8ttUEllJDffkcdrj2k8aJQIu+TLc=
github.com/argoproj/argo-cd/v2 v2.9.2/go.mod h1:+Ve37mJedhW4fpRTpQNbE9VaSmkijET1UgxZOFNi3dI=
github.com/argoproj/argo-rollouts v1.6.6 h1:JCJ0cGAwWkh2xCAHZ1OQmrobysRjCatmG9IZaLJpS1g=
github.com/argoproj/argo-rollouts v1.6.6/go.mod h1:X2kTiBaYCSounmw1kmONdIZTwJNzNQYC0SrXUgSw9UI=
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY=
Expand Down Expand Up @@ -1633,8 +1635,8 @@ github.com/rogpeppe/go-internal v1.4.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE
github.com/rogpeppe/go-internal v1.5.0/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rs/cors v1.6.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rubenv/sql-migrate v0.0.0-20200212082348-64f95ea68aa3/go.mod h1:rtQlpHw+eR6UrqaS3kX1VYeaCxzCVdimDS7g5Ln4pPc=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
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 67a9464

Please sign in to comment.