-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
e2e: Use fake notifications service as a workaround
Right now the upstream notification service exported at https://github.com/redhat-developer/rhdh-plugin-export-backstage-backstage/releases is not working due to some compatibility issues with upstream RHDH backstage version. Till we solve this problem the e2e test will use a fake notifications pod that would log all the requests to the container log. We can examine the container logs and make sure the notifications were sent in the right format, for now. Signed-off-by: Roy Golan <[email protected]>
- Loading branch information
Showing
4 changed files
with
40 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
|
@@ -68,7 +69,7 @@ jobs: | |
kubectl wait --for=condition=Ready=true pods -l "app.kubernetes.io/name=tackle-ui" -n my-konveyor-operator --timeout=120s | ||
# now MTA workflow can execute agains tackle-ui.my-konveyor-operator.svc:8080 | ||
- name: Deploy Janus-idp-workflow-helm (janus + sonataflow-opertor) | ||
- name: Deploy Orchestrator-k8s helm chart | ||
run: | | ||
helm repo add orchestrator https://parodos-dev.github.io/orchestrator-helm-chart | ||
helm install orchestrator orchestrator/orchestrator-k8s | ||
|
@@ -81,6 +82,11 @@ jobs: | |
kubectl get pods -o wide | ||
kubectl wait --for=condition=Ready=true pods -l "app=sonataflow-platform" --timeout=120s | ||
- name: Deploy fake notifications service | ||
run: | | ||
source e2e/helper-functions.sh | ||
create-fake-notifications-service | ||
- name: Download sonataflow artifacts generated manifests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -100,7 +106,7 @@ jobs: | |
- name: Deploy MTA serverless workflow | ||
run: | | ||
# Set the endpoint to the tackle-ui service | ||
yq --inplace '.spec.podTemplate.container.env |= ( . + [{"name": "QUARKUS_REST_CLIENT_MTA_JSON_URL", "value": "http://tackle-ui.my-konveyor-operator.svc:8080/hub"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}] )' manifests/01-sonataflow_mtaanalysis.yaml | ||
yq --inplace '.spec.podTemplate.container.env |= ( . + [{"name": "QUARKUS_REST_CLIENT_MTA_JSON_URL", "value": "http://tackle-ui.my-konveyor-operator.svc:8080/hub"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://fake-notifications-service.default.svc.cluster.local:8080/api/notifications/"}] )' manifests/01-sonataflow_mtaanalysis.yaml | ||
# Disable persistence for e2e tests | ||
yq e '.spec.persistence = {}' -i manifests/01-sonataflow_mtaanalysis.yaml | ||
|
@@ -114,11 +120,6 @@ jobs: | |
cat manifests/01-sonataflow_mtaanalysis.yaml | ||
echo "---" | ||
# Set notification external access token | ||
echo " Set notification external access token" | ||
yq --inplace '.data."NOTIFICATIONS_BEARER_TOKEN" = "ZTJldG9rZW4="' manifests/01-secret_mtaanalysis.yaml # notsecret | ||
cat manifests/01-secret_mtaanalysis.yaml | ||
# deploy the manifests created by the ${{ steps.build-image.outputs.image }} image | ||
kubectl apply -f manifests/ | ||
sleep 5 | ||
|
@@ -128,7 +129,6 @@ jobs: | |
kubectl get pods -o wide | ||
kubectl wait --for=condition=Ready=true pods -l "app=mtaanalysis" --timeout=5m | ||
- uses: actions/checkout@v4 | ||
- name: Run e2e script | ||
run: | | ||
e2e/mta.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
|
@@ -81,6 +82,11 @@ jobs: | |
kubectl get pods -o wide | ||
kubectl wait --for=condition=Ready=true pods -l "app=sonataflow-platform" --timeout=600s | ||
- name: Deploy fake notifications service | ||
run: | | ||
source e2e/helper-functions.sh | ||
create-fake-notifications-service | ||
- name: Download sonataflow artifacts generated manifests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -100,7 +106,7 @@ jobs: | |
- name: Deploy MTA serverless workflow | ||
run: | | ||
# Set the endpoint to the tackle-ui service | ||
yq --inplace '.spec.podTemplate.container.env |= ( . + [{"name": "QUARKUS_REST_CLIENT_MTA_JSON_URL", "value": "http://tackle-ui.my-konveyor-operator.svc:8080"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://janus-idp-workflows-backstage.default.svc.cluster.local:7007/api/notifications/"}] )' manifests/01-sonataflow_mta-analysis-v6.yaml | ||
yq --inplace '.spec.podTemplate.container.env |= ( . + [{"name": "QUARKUS_REST_CLIENT_MTA_JSON_URL", "value": "http://tackle-ui.my-konveyor-operator.svc:8080"}, {"name": "BACKSTAGE_NOTIFICATIONS_URL", "value": "http://fake-notifications-service.default.svc.cluster.local:8080/api/notifications/"}] )' manifests/01-sonataflow_mta-analysis-v6.yaml | ||
# Disable persistence for e2e tests | ||
yq e '.spec.persistence = {}' -i manifests/01-sonataflow_mta-analysis-v6.yaml | ||
|
@@ -123,7 +129,6 @@ jobs: | |
kubectl get pods -o wide | ||
kubectl wait --for=condition=Ready=true pods -l "app=mta-analysis-v6" --timeout=10m | ||
- uses: actions/checkout@v4 | ||
- name: Run e2e script | ||
run: | | ||
e2e/mta-v6.x.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
function create-fake-notifications-service() { | ||
oc run fake-notifications-service --image=docker.io/golang:1.21 --port=8080 -- bash -c 'cat <<EOF > main.go && go run main.go | ||
package main | ||
import ( | ||
"fmt" | ||
"log" | ||
"net/http" | ||
) | ||
func main() { | ||
log.Fatal(http.ListenAndServe(":8080", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { fmt.Println(r) }))) | ||
} | ||
EOF | ||
' | ||
kubectl wait --for=condition=Ready=true pods fake-notifications-service --timeout=5m | ||
kubectl expose pods/fake-notifications-service | ||
} |