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

test(chart): Sanity tests Selenium Grid chart via Makefile commands #2029

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Nov 28, 2023

Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Sanity tests Selenium Grid chart via Makefile commands

Motivation and Context

Take advantage from PR #2027, there are some enhancements on sanity tests for the Selenium Grid chart (link to #1975)

  1. Makefile is updated new make commands for a few purposes. Someone is able to test their changes in their local before pushing and running workflow. Try to have the same environment in development and CI
# Setup Kubernetes environment
make chart_setup_env

# Setup Kubernetes cluster
make chart_cluster_setup

# Test Selenium Grid on Kubernetes
make chart_test

# Cleanup Kubernetes cluster
make chart_cluster_cleanup
  1. Add charts/selenium-grid/TESTING.md to capture all related testing to chart

  2. Update chart test workflow to use make commands.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@VietND96
Copy link
Member Author

Hi @amardeep2006, can you please also have a review on this? Thanks!

@VietND96 VietND96 requested a review from diemol November 28, 2023 07:32
@VietND96 VietND96 self-assigned this Nov 28, 2023
Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Some minor comments.

.github/workflows/helm-chart-test.yml Outdated Show resolved Hide resolved
.github/workflows/helm-chart-test.yml Outdated Show resolved Hide resolved
Signed-off-by: Viet Nguyen Duc <[email protected]>
@VietND96 VietND96 requested a review from diemol November 28, 2023 10:25
Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @VietND96!

@diemol diemol merged commit 7b3dfe9 into SeleniumHQ:trunk Nov 28, 2023
5 checks passed
@VietND96 VietND96 deleted the test-chart branch November 28, 2023 10:44
@amardeep2006
Copy link
Contributor

amardeep2006 commented Nov 28, 2023

Hi @amardeep2006, can you please also have a review on this? Thanks!

  1. I was looking at the run logs and seems few tests are failing with error 504. Probably Kubernetes needs some time to make the Browser Nodes operational.
  2. Also It seems that even after failing the tests, the GitHub action does not break. Shouldn't it have failed ?
  3. Is this possible to make kubernetes/helm/kubectl installation optional ? There may be developer who have kubernetes already up an running on the machine (e.g. I use Rancher desktop mostly that comes with helm,kubectl, ingress and k3s).
    They can simply apply chart and run ct lint / Selenium test cases.

https://github.com/SeleniumHQ/docker-selenium/actions/runs/7017524980/job/19090970950

@VietND96
Copy link
Member Author

Yes, I was also aware of this flaky and incorrect behavior. I am trying to make it stable

@VietND96
Copy link
Member Author

VietND96 commented Nov 28, 2023

Is this possible to make kubernetes/helm/kubectl installation optional ? There may be developer who have kubernetes already up an running on the machine (e.g. I use Rancher desktop mostly that comes with helm,kubectl, ingress and k3s).
They can simply apply chart and run ct lint / Selenium test cases.

On this use case, how about if you jump to run make chart_test? Is it working?
Later I will break down the script with individual tool/component install...

@amardeep2006
Copy link
Contributor

Yes, I was also aware of this flaky and incorrect behavior. I am trying to make it stable

I was using K8sSmokeTest.py for this. Basically it makes sure cluster is up an running before I fired the tests.

@VietND96
Copy link
Member Author

I was using K8sSmokeTest.py for this. Basically it makes sure cluster is up an running before I fired the tests.

Yes, while integrating autoscaling & ingress tests, I also tried to merge your script into using SmokeTest.py, since it is same func to wait for Hub is up, just some timeout values are pulled out as arguments, K8s tests set timeout a little bit longer due to scaling interval and time for node replicas from 0 to 1.
Regarding the 504 error, I found looks like same as kubernetes/ingress-nginx#3976. The default timeout is 60s, if a request in the session queue over 60s without node serve on time, the client web driver will throw this error.
In the override values of ingress, under ingress.annotations I added

    nginx.ingress.kubernetes.io/proxy-connect-timeout: "360"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "360"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "360"

Let us monitor how it is stable

Regarding incorrect behavior, failed tests without job failed, it is due to in bash script handle trapping the error signal inproperly, step to cleanup between return 0 replaces the first error code from tests.
All those things will be fixed in the next PR

@VietND96 VietND96 linked an issue Nov 30, 2023 that may be closed by this pull request
@VietND96 VietND96 changed the title test: Sanity tests Selenium Grid chart via Makefile commands test(chart): Sanity tests Selenium Grid chart via Makefile commands Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Helm Charts maintainer needed
3 participants