Skip to content
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

Add kubectl port-froward to integration tests #2645

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mabdelgowa
Copy link

@mabdelgowa mabdelgowa commented Dec 5, 2024

Add kubectl port-froward to integration tests

@CLAassistant
Copy link

CLAassistant commented Dec 5, 2024

CLA assistant check
All committers have signed the CLA.

@aabouzaid aabouzaid self-requested a review December 10, 2024 17:27
Copy link
Member

@aabouzaid aabouzaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution 🙌
I've left a couple of comments.

@aabouzaid
Copy link
Member

Also, don't forget to rebase to get the latest updates.

@mabdelgowa
Copy link
Author

Hi eng @aabouzaid 👋👋👋👋👋👋
I rebased my forked repo and updated the testsuite-core.yaml file with two ranges (one for port forward cmmand and another one for verification ) . recheck it right now

type: exec
range:
- component: zeebe-gateway
script: "{{.portforward}}/camunda-zeebe-gateway 26500:26500"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mabdelgowa, this will not work as port forwarding is a blocking command, and it will not return (will wait forever as it works).

So you can port forward and check at the same time in the script section something like this:

[...]
 range:
  - component: "Zeebe Gateway"
    serviceName: "camunda-zeebe-gateway"
    servicePort:  "26500"
    [...]
script: |
  (kubectl port-forward svc/{{ .serviceName }} {{ .servicePort }}:{{ .servicePort }} &
  curl localhost:{{ .servicePort }})

Please ensure to test it locally first to ensure the proposed change works as expected (you can test it with any service, not necessarily Camunda deployment).

@github-actions github-actions bot added version/8.3 Camunda applications/cycle version version/alpha Camunda applications/cycle version (this is a pointer to alpha) labels Dec 18, 2024
@mabdelgowa
Copy link
Author

mabdelgowa commented Dec 18, 2024

@aabouzaid I tested it locally after editing the script line to be like this (kubectl port-forward svc/{{.value.serviceName}} {{.value.servicePort}}:{{.value.servicePort}} > /dev/null 2>&1 & curl localhost:{{.value.servicePort}}) and it passed for the opened services as it in the attached screenshots (the services which I used was camunda-zeebe-gateway --> 8080 not 26500 & camunda-operate --> 8081 ) it was only for testing
image
image

Copy link
Member

@aabouzaid aabouzaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are now in the right direction. 👏
I've left a couple of notes.

@github-actions github-actions bot added version/8.2 Camunda applications/cycle version version/8.4 Camunda applications/cycle version version/8.5 Camunda applications/cycle version version/8.6 Camunda applications/cycle version labels Dec 18, 2024
@mabdelgowa
Copy link
Author

@aabouzaid
check it right now
All components were capitalized, unnecessary lines were deleted, and only one line was for the script. Also, all changes were added to all versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants