Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions cicd-scripts/run-local-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,27 @@ container_node_ip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPA
# container nonk8s api server
hub_nonk8s_api_server="https://${container_node_ip}:30080"

# container postgres uri
container_pg_port="32432"
database_uri=$(kubectl get secret storage-secret -n $hub_namespace --kubeconfig ${hub_kubeconfig} -ojsonpath='{.data.database_uri}' | base64 -d)
container_pg_uri=$(echo $database_uri | sed "s|@.*hoh|@${container_node_ip}:${container_pg_port}/hoh|g")

printf "options:" > $OPTIONS_FILE
printf "\n hub:" >> $OPTIONS_FILE
printf "\n name: $HUB_OF_HUB_NAME" >> $OPTIONS_FILE
printf "\n namespace: ${hub_namespace}" >> $OPTIONS_FILE
printf "\n apiServer: ${hub_api_server}" >> $OPTIONS_FILE
printf "\n nonk8sApiServer: ${hub_nonk8s_api_server}" >> $OPTIONS_FILE
printf "\n kubeconfig: ${hub_kubeconfig}" >> $OPTIONS_FILE
printf "\n kubecontext: ${hub_kubecontext}" >> $OPTIONS_FILE
printf '\n databaseURI: %s' ${container_pg_uri} >> $OPTIONS_FILE # contain $ need to use %s
if [ ! -f "IS_CANARY_ENV" ];then
printf "\n kubeconfig: ${ROOT_DIR}/test/setup/config/kubeconfig" >> $OPTIONS_FILE
printf "\n crdsDir: ${ROOT_DIR}/pkg/testdata/crds" >> $OPTIONS_FILE
printf "\n storagePath: ${ROOT_DIR}/test/setup/hoh/postgres_setup.sh" >> $OPTIONS_FILE
printf "\n transportPath: ${ROOT_DIR}/test/setup/hoh/kafka_setup.sh" >> $OPTIONS_FILE
else
printf "\n kubeconfig: ${hub_kubeconfig}" >> $OPTIONS_FILE
printf "\n storagePath: ${ROOT_DIR}/operator/config/samples/storage/deploy_postgres.sh" >> $OPTIONS_FILE
printf "\n transportPath: ${ROOT_DIR}/operator/config/samples/transport/deploy_kafka.sh" >> $OPTIONS_FILE
fi
printf "\n kubecontext: ${hub_kubecontext}" >> $OPTIONS_FILE
printf "\n databaseExternalHost: ${container_node_ip}" >> $OPTIONS_FILE
printf "\n databaseExternalPort: 32432" >> $OPTIONS_FILE
printf "\n mghManagerImageREF: quay.io/stolostron/multicluster-global-hub-manager:latest" >> $OPTIONS_FILE
printf "\n mghAgentImageREF: quay.io/stolostron/multicluster-global-hub-agent:latest" >> $OPTIONS_FILE
printf "\n clusters:" >> $OPTIONS_FILE

for i in $(seq 1 "${HUB_CLUSTER_NUM}"); do
Expand Down
1 change: 0 additions & 1 deletion cicd-scripts/run-prow-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,5 @@ ssh "${OPT[@]}" "$HOST" sudo yum install gcc git wget jq -y
ssh "${OPT[@]}" "$HOST" "sudo sh -c 'echo \"fs.inotify.max_user_watches=524288\" >> /etc/sysctl.conf && echo \"fs.inotify.max_user_instances=1024\" >> /etc/sysctl.conf && sysctl -p /etc/sysctl.conf'"
echo "setup e2e environment"
ssh "${OPT[@]}" "$HOST" "cd $HOST_DIR && . test/resources/env.list && sudo make e2e-setup-dependencies && make e2e-setup-start" > >(tee "$ARTIFACT_DIR/run-e2e-setup.log") 2>&1

echo "runn e2e tests"
ssh "${OPT[@]}" "$HOST" "cd $HOST_DIR && . test/resources/env.list && make e2e-tests-all && make e2e-tests-prune" > >(tee "$ARTIFACT_DIR/run-e2e-test.log") 2>&1
4 changes: 2 additions & 2 deletions test/pkg/e2e/hoh-application_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ var _ = Describe("Deploy the application to the managed cluster", Label("e2e-tes
transport := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
httpClient = &http.Client{Timeout: time.Second * 20, Transport: transport}
httpClient = &http.Client{Timeout: time.Second * 60, Transport: transport}
var err error
managedClusters, err = getManagedCluster(httpClient, httpToken)
if err != nil {
Expand All @@ -50,7 +50,7 @@ var _ = Describe("Deploy the application to the managed cluster", Label("e2e-tes
return fmt.Errorf("managed cluster is not exist")
}
return nil
}, 3*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())
}, 5*time.Minute, 5*time.Second).ShouldNot(HaveOccurred())

By("Get the appsubreport client")
scheme := runtime.NewScheme()
Expand Down
Loading