-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup E2E test using NATS Backend #30
Changes from 37 commits
883f97f
ff276ce
9164364
412bb90
a2af197
c61ff0e
0982fa5
087b5cd
c276ba7
f2dbfef
4b264c1
288ecd8
1341054
1fb940d
1b2dd7f
5e513b3
b4d2709
08a3ed9
03edb93
6c78a9a
ba87682
4353671
07ae627
dce976f
7c2ee4a
260c0fe
e6f803b
b309ef4
9cba00a
f7dcbe2
a989fc5
cdd4190
17e2b19
47de078
616b945
12e3bc0
13d0d9a
d6138d6
840c401
64e162e
d254cbb
2be5728
75fcad0
06ca070
bc2bda5
f8cec62
b14c40a
acc5b7d
1e6bcb4
c2e4a71
cdcc5f3
ea5b8fb
10e2564
8ffdb8c
d2c4e2d
0192c4d
43f7807
22d997d
d69cdb3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
name: E2E Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
- "release-*" | ||
paths-ignore: | ||
- "docs/**" | ||
- "**.md" | ||
- "sec-scanners-config.yaml" | ||
|
||
env: | ||
NATS_MANAGER_IMAGE: europe-docker.pkg.dev/kyma-project/prod/nats-manager:latest | ||
EVENTING_MANAGER_IMAGE: europe-docker.pkg.dev/kyma-project/prod/eventing-manager:latest | ||
EPP_IMAGE: europe-docker.pkg.dev/kyma-project/dev/eventing-publisher-proxy:PR-${{ github.event.number }} | ||
|
||
jobs: | ||
e2e-nats: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout EPP repository | ||
uses: actions/checkout@v4 | ||
with: | ||
path: main | ||
|
||
- name: Checkout EM repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: kyma-project/eventing-manager | ||
path: eventing-manager | ||
|
||
- name: Checkout NM repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: kyma-project/nats-manager | ||
path: nats-manager | ||
|
||
- name: Cache binaries | ||
id: cache-binaries | ||
uses: actions/cache@v3 | ||
with: | ||
path: bin | ||
key: ${{ runner.os }}-bin | ||
|
||
- name: Install k3d tools | ||
run: | | ||
make -C eventing-manager/hack/ci/ install-k3d-tools | ||
|
||
- name: Install Kyma CLI & setup k3d cluster using kyma CLI | ||
run: | | ||
make -C eventing-manager kyma | ||
make -C main/hack/ci/ create-k3d | ||
kubectl version | ||
kubectl cluster-info | ||
|
||
- name: Create Namespace | ||
run: | | ||
kubectl create ns kyma-system | ||
|
||
- name: Setup NATS Manager | ||
run: | | ||
make -C nats-manager install | ||
|
||
- name: Deploy NATS Manager | ||
run: | | ||
make -C nats-manager deploy IMG=$NATS_MANAGER_IMAGE | ||
|
||
- name: Create NATS CR and resources and check configuration | ||
run: | | ||
make -C nats-manager e2e-setup | ||
|
||
- name: Setup Eventing Manager | ||
run: | | ||
make -C eventing-manager install | ||
|
||
- name: Deploy Eventing Manager | ||
run: | | ||
make -C eventing-manager deploy IMG=$EVENTING_MANAGER_IMAGE | ||
|
||
- name: Wait for build job to succeed | ||
uses: kyma-project/wait-for-commit-status-action@2b3ffe09af8b6f40e1213d5fb7f91a7bd41ffb20 | ||
with: | ||
context: "pull-eventing-publisher-proxy-build" | ||
commit_ref: "${{ github.event.pull_request.head.sha }}" # Note: 'github.event.pull_request.head.sha' is not same as 'github.sha' on pull requests. | ||
timeout: 600000 # 10 minutes in milliseconds | ||
# The check interval is kept long otherwise it will exhaust the GitHub rate limit (More info: https://docs.github.com/en/rest/overview/resources-in-the-rest-api?apiVersion=2022-11-28#rate-limiting) | ||
check_interval: 60000 # 1 minute in milliseconds | ||
env: | ||
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | ||
GITHUB_OWNER: "${{ github.repository_owner }}" | ||
GITHUB_REPO: "eventing-publisher-proxy" | ||
|
||
- name: Setup Eventing Manager with new EPP image | ||
run: | | ||
kubectl patch deployment eventing-manager -n kyma-system --type='json' -p='[{"op": "replace", "path": "/spec/template/spec/containers/0/env/8/value", "value": "'$EPP_IMAGE'"}]' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So if we later do any changes to ENVs of eventing-manager deployment, will this command fail? as I see the indexes are hard coded There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can get the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. I'll check to improve the patch command to not rely on the indexes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
- name: Create eventing CR and resources and check configuration | ||
run: | | ||
make -C eventing-manager e2e-setup | ||
|
||
- name: Setup subscriptions for testing | ||
run: | | ||
make -C eventing-manager e2e-eventing-setup | ||
|
||
- name: Test eventing | ||
run: | | ||
make -C eventing-manager e2e-eventing | ||
mfaizanse marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: On error get NATS CR | ||
if: failure() | ||
run: | | ||
kubectl get nats -n kyma-system -o yaml | ||
|
||
- name: On error get Eventing CR | ||
if: failure() | ||
run: | | ||
kubectl get eventing -n kyma-system -o yaml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
KYMA_CLI ?= "/home/runner/work/eventing-publisher-proxy/eventing-publisher-proxy/eventing-manager/bin/kyma-unstable" | ||
CLUSTER_NAME ?= kyma | ||
REGISTRY_PORT ?= 5001 | ||
|
||
.PHONY: create-k3d | ||
create-k3d: ## Create k3d with kyma CRDs. | ||
"${KYMA_CLI}" provision k3d -p 8081:80@loadbalancer -p 8443:443@loadbalancer --registry-port ${REGISTRY_PORT} --name ${CLUSTER_NAME} --ci |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
function get_kyma_file_name () { | ||
|
||
local _OS_TYPE=$1 | ||
local _OS_ARCH=$2 | ||
|
||
[ "$_OS_TYPE" == "Linux" ] && [ "$_OS_ARCH" == "x86_64" ] && echo "kyma-linux" || | ||
[ "$_OS_TYPE" == "Linux" ] && [ "$_OS_ARCH" == "arm64" ] && echo "kyma-linux-arm" || | ||
[ "$_OS_TYPE" == "Windows" ] && [ "$_OS_ARCH" == "x86_64" ] && echo "kyma.exe" || | ||
[ "$_OS_TYPE" == "Windows" ] && [ "$_OS_ARCH" == "arm64" ] && echo "kyma-arm.exe" || | ||
[ "$_OS_TYPE" == "Darwin" ] && [ "$_OS_ARCH" == "x86_64" ] && echo "kyma-darwin" | ||
} | ||
|
||
get_kyma_file_name "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use latest image tag? or image from latest release of eventing+nats manager?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering the same. is there a way to always get
latest-rel
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest
will ensure the current EPP changes work with the newest changes of EM and NM. If we use a release tag, we need to update the image every time there is a new release. If we prefer a stable environment by using a release tag, I'd try and see if I can refer to these env variables from somewhere else, so we don't have to remember to bump them in the test itself.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used
curl
to get the latest release for the Eventing Manager. Same can be done for NATS Manager as soon as there is a new release.